internal FileNameGenerator(RecorderSettings recorderSettings) { m_RecorderSettings = recorderSettings; m_Wildcards = new List<Wildcard> { new Wildcard(DefaultWildcard.Recorder, RecorderResolver), new Wildcard(DefaultWildcard.Time, TimeResolver), new Wildcard(DefaultWildcard.Take, TakeResolver), new Wildcard(DefaultWildcard.Date, DateResolver), new Wildcard(DefaultWildcard.Project, ProjectNameResolver), new Wildcard(DefaultWildcard.Product, ProductNameResolver), new Wildcard(DefaultWildcard.Scene, SceneResolver), new Wildcard(DefaultWildcard.Resolution, ResolutionResolver), new Wildcard(DefaultWildcard.Frame, FrameResolver), new Wildcard(DefaultWildcard.Extension, ExtensionResolver) }; }
RecorderComponent GetRecorderComponent(RecorderSettings settings) { var sceneHook = GetSessionHook(); if (sceneHook == null) { return(null); } var component = sceneHook.GetComponentsInChildren <RecorderComponent>().FirstOrDefault(r => r.session.settings == settings); if (component == null) { component = sceneHook.AddComponent <RecorderComponent>(); } return(component); }
/// <summary> /// Are we currently capturing SubFrames. /// </summary> /// <returns>bool</returns> internal static bool CaptureAccumulation(RecorderSettings settings) { #if HDRP_ACCUM_API var hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline; if (hdPipeline != null && settings.IsAccumulationSupported()) { IAccumulation accumulation = settings as IAccumulation; if (accumulation != null) { AccumulationSettings aSettings = accumulation.GetAccumulationSettings(); if (aSettings != null) { return(aSettings.CaptureAccumulation); } } } #endif return(false); }
RecorderItem CreateRecorderItem(RecorderSettings recorderSettings) { var info = RecordersInventory.GetRecorderInfo(recorderSettings.GetType()); var hasError = info == null; var recorderItem = new RecorderItem(m_ControllerSettings, recorderSettings, hasError ? null : info.iconName); recorderItem.OnEnableStateChanged += enabled => { if (enabled) { m_RecordingListItem.selection = recorderItem; } }; if (hasError) { recorderItem.state = RecorderItem.State.HasErrors; } return(recorderItem); }
public RecorderItem(RecorderControllerSettings prefs, RecorderSettings recorderSettings, string iconName) { settings = recorderSettings; if (settings != null) { editor = Editor.CreateEditor(settings); } UIElementHelper.SetFlex(this, 1.0f); style.flexDirection = FlexDirection.Row; m_Toggle = new Toggle(); #if UNITY_2019_1_OR_NEWER m_Toggle.RegisterValueChangedCallback(evt => #elif UNITY_2018_3_OR_NEWER m_Toggle.OnValueChanged(evt => #else m_Toggle.OnToggle(() => #endif { SetItemEnabled(prefs, UIElementHelper.GetToggleValue(m_Toggle)); }); Add(m_Toggle); m_RecorderIcon = LoadIcon(iconName); if (m_RecorderIcon == null) { m_RecorderIcon = LoadIcon("customrecorder_16"); } UpdateState(false); var iconContainer = new IMGUIContainer(() => // UIElement Image doesn't support tint yet. Use IMGUI instead. { var r = EditorGUILayout.GetControlRect(); r.width = r.height = Mathf.Max(r.width, r.height); var c = GUI.color; var newColor = Color.white; if (m_Disabled) { newColor.a = 0.5f; } else { if (!m_Selected) { newColor.a = 0.8f; } } GUI.color = newColor; GUI.DrawTexture(r, m_Icon); GUI.color = c; }); iconContainer.AddToClassList("RecorderItemIcon"); iconContainer.SetEnabled(false); Add(iconContainer); m_EditableLabel = new EditableLabel { text = settings.name }; m_EditableLabel.OnValueChanged(newValue => { settings.name = newValue; prefs.Save(); }); Add(m_EditableLabel); var recorderEnabled = settings.enabled; UIElementHelper.SetToggleValue(m_Toggle, recorderEnabled); SetItemEnabled(prefs, recorderEnabled); }
void AddRecorderInternal(RecorderSettings recorder) { ApplyGlobalSetting(recorder); m_RecorderSettings.Add(recorder); }
public RTInputSelector(RecorderSettings recSettings, string title) { this.recSettings = recSettings; this.title = title; }
internal void Init(RecorderSettings target, Action onSelectionChanged = null) { m_OnSelectionChanged = onSelectionChanged; m_Target = target; m_InitialValue = new Preset(target); }