public override void OnInspectorGUI() { serializedObject.Update(); draw_capture_ = EditorUtility.DrawMethodGroup(draw_capture_, "Capture Settings", DrawCaptureSettings); draw_pipeline_ = EditorUtility.DrawMethodGroup(draw_pipeline_, "Pipeline Settings", DrawPipelineSettings); draw_import_ = EditorUtility.DrawMethodGroup(draw_import_, "Import Settings", DrawImportSettings); draw_scenebuilder_ = EditorUtility.DrawMethodGroup(draw_scenebuilder_, "Scene Builder Settings", DrawSceneBuilderSettings); DrawButtons(); serializedObject.ApplyModifiedProperties(); if (bake_progress_window_ != null && bake_progress_window_.IsComplete()) { bake_progress_window_.Close(); bake_progress_window_ = null; capture_builder_ = null; capture_status_ = null; } if (runner_window_ != null && runner_window_.IsComplete()) { runner_window_.Close(); runner_window_ = null; collection_runner_ = null; runner_status_ = null; } }
public void Capture() { SeuratAutomator automator = (SeuratAutomator)target; string capture_output_folder = automator.output_folder_; if (capture_output_folder.Length <= 0) { capture_output_folder = FileUtil.GetUniqueTempPathInProject(); } Directory.CreateDirectory(capture_output_folder); int numCaptures = automator.transform.childCount; capture_status_ = new AutomatorStatus(); capture_builder_ = new CaptureBuilder[numCaptures]; CaptureHeadbox[] headboxes = new CaptureHeadbox[numCaptures]; bake_progress_window_ = (AutomateWindow)EditorWindow.GetWindow(typeof(AutomateWindow)); bake_progress_window_.SetupStatus(capture_status_); int num_not_null = 0; for (int i = 0; i < numCaptures; i++) { headboxes[i] = automator.transform.GetChild(i).GetComponent <CaptureHeadbox>(); if (headboxes[i].isActiveAndEnabled) { num_not_null++; capture_builder_[i] = new CaptureBuilder(); automator.OverrideHeadbox(headboxes[i]); string output = capture_output_folder + "\\" + (i + 1); headboxes[i].output_folder_ = output; UnityEditor.EditorUtility.SetDirty(headboxes[i]); Directory.CreateDirectory(output); capture_builder_[i].BeginCapture(headboxes[i], output, 1, capture_status_, "Capture " + (i + 1) + ": "); } } CaptureHeadbox[] total_headboxes = new CaptureHeadbox[num_not_null]; CaptureBuilder[] total_capture_builders = new CaptureBuilder[num_not_null]; int j = 0; for (int i = 0; i < numCaptures; i++) { if (capture_builder_[i] != null) { total_headboxes[j] = headboxes[i]; total_capture_builders[j] = capture_builder_[i]; j++; } } bake_progress_window_.SetupCaptureProcess(total_headboxes, total_capture_builders); }
public void SetGUI(AutomateWindow bake_gui) { bake_gui_ = bake_gui; }