Ejemplo n.º 1
0
        /// <summary>
        /// Displays a GUI enabling the user to create a mesh based on the camera's Z-buffer.
        /// </summary>
        public override void OnInspectorGUI()
        {
            // Start the GUI.
            GeneralToolkit.EditorStart(serializedObject, _targetObject);

            // Start a change check.
            EditorGUI.BeginChangeCheck();

            // Enable the user to choose the camera model.
            GeneralToolkit.EditorNewSection("Camera model");
            CameraModelEditor.SectionCamera(_objectCameraModel);

            // End the change check.
            bool shouldUpdatePreview = EditorGUI.EndChangeCheck();

            // Enable the user to choose parameters for depth processing.
            GeneralToolkit.EditorNewSection("Depth processing parameters");
            SectionDepthProcessing(_targetObject.GetCameraModel().isOmnidirectional);

            // Enable the user to generate the mesh.
            GeneralToolkit.EditorNewSection("Generate");
            SectionGenerateButton();

            // End the GUI.
            GeneralToolkit.EditorEnd(serializedObject);

            // If the preview window should be updated, notify the target object.
            if (shouldUpdatePreview)
            {
                ((PerViewMeshesQSTRDB)_targetObject).UpdateCameraModel();
            }
        }
        /// <summary>
        /// Displays a GUI enabling the user to modify various rendering parameters.
        /// </summary>
        public override void OnInspectorGUI()
        {
            // Start the GUI.
            GeneralToolkit.EditorStart(serializedObject, _targetObject);

            // Enable the user to select the source data directory.
            GeneralToolkit.EditorNewSection("Source data");
            SectionDataDirectory();
            // Enable the user to specify launch options.
            GeneralToolkit.EditorNewSection("Launch options");
            SectionLaunchOptions();
            // Start a change check.
            EditorGUI.BeginChangeCheck();
            // Enable the user to select a blending method.
            GeneralToolkit.EditorNewSection("Blending method");
            SectionBlendingMethod();
            // Enable the user to select an evaluation method.
            GeneralToolkit.EditorNewSection("Evaluation method");
            SectionEvaluationMethod();
            // End the change check.
            bool shouldPreviewChange = EditorGUI.EndChangeCheck();

            // End the GUI.
            GeneralToolkit.EditorEnd(serializedObject);

            // If the preview should change, inform the target object to update the preview images.
            if (shouldPreviewChange)
            {
                _targetObject.processing.cameraSetup.onPreviewIndexChangeEvent.Invoke();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Displays a GUI enabling the user to set up a COLIBRI VR directory structure from a set of images from the Stanford Light Field Archive.
        /// </summary>
        public override void OnInspectorGUI()
        {
            // Start the GUI.
            GeneralToolkit.EditorStart(serializedObject, _targetObject);

            // Enable the user to select the input directory.
            GeneralToolkit.EditorNewSection("Data directory");
            SectionDataDirectory();

            // Enable the user to parse the camera setup from the set of images.
            GeneralToolkit.EditorNewSection("Parse camera setup");
            SectionParseCameraSetup();

            // End the GUI.
            GeneralToolkit.EditorEnd(serializedObject);
        }
        /// <summary>
        /// Displays a GUI enabling the user to see the camera model parameters.
        /// Intentionally, this interface cannot be used to modify the parameters.
        /// </summary>
        public override void OnInspectorGUI()
        {
            // Start the GUI.
            GeneralToolkit.EditorStart(serializedObject, _targetObject);
            bool isGUIEnabled = GUI.enabled;

            GUI.enabled = false;

            // Enable the user to see the camera parameters.
            GeneralToolkit.EditorNewSection("Camera parameters");
            SectionCamera(serializedObject);

            // End the GUI.
            GUI.enabled = isGUIEnabled;
            GeneralToolkit.EditorEnd(serializedObject);
        }
        /// <summary>
        /// Displays a GUI enabling the user to create a mesh based on the camera's Z-buffer.
        /// </summary>
        public override void OnInspectorGUI()
        {
            // Start the GUI.
            GeneralToolkit.EditorStart(serializedObject, _targetObject);

            // Start a change check.
            EditorGUI.BeginChangeCheck();

            // Enable the user to select the source data directory.
            GeneralToolkit.EditorNewSection("Source data");
            COLIBRIVR.Processing.ProcessingEditor.SectionDataDirectory(_targetProcessing);
            // Enable the user to select the source camera index.
            SubsectionSourceCameraIndex();

            // End the change check.
            bool shouldDestroyMesh = EditorGUI.EndChangeCheck();

            // Enable the user to choose parameters for depth processing.
            CameraModel cameraModel = _targetObject.GetCameraModel();

            if (cameraModel != null)
            {
                GeneralToolkit.EditorNewSection("Depth processing parameters");
                SectionDepthProcessing(cameraModel.isOmnidirectional);

                // Enable the user to generate the mesh.
                GeneralToolkit.EditorNewSection("Generate");
                bool isGUIEnabled = GUI.enabled;
                GUI.enabled = (_targetProcessing.sourcePerViewGeometryCount > 0);
                SectionGenerateButton();
                GUI.enabled = isGUIEnabled;
            }

            // End the GUI.
            GeneralToolkit.EditorEnd(serializedObject);

            // If the mesh should be destroyed, do so.
            if (shouldDestroyMesh)
            {
                _targetObject.DestroyMesh();
            }
        }
        /// <summary>
        /// Enables the user to specify settings for the COLIBRI VR package.
        /// </summary>
        /// <param name="packageSettings"></param> The package settings object.
        public static void SectionPackageSettings(COLIBRIVRSettings packageSettings)
        {
            SerializedObject serializedSettings = new SerializedObject(packageSettings);

            serializedSettings.Update();

            GeneralToolkit.EditorNewSection("Package settings");
            string             label   = "Max. resolution for preview";
            string             tooltip = "Maximum resolution for the preview images.";
            SerializedProperty propertyPreviewMaxResolution = serializedSettings.FindProperty(_propertyNamePreviewMaxResolution);

            propertyPreviewMaxResolution.intValue = EditorGUILayout.IntSlider(new GUIContent(label, tooltip), propertyPreviewMaxResolution.intValue, 1, 8192);

            GeneralToolkit.EditorNewSection("External helper tools");
            packageSettings.COLMAPSettings.EditorSettingsFoldout();
            packageSettings.BlenderSettings.EditorSettingsFoldout();
            packageSettings.InstantMeshesSettings.EditorSettingsFoldout();

            serializedSettings.ApplyModifiedProperties();
        }
        /// <summary>
        /// Displays a GUI enabling the user to perform various processing tasks.
        /// </summary>
        public override void OnInspectorGUI()
        {
            // Start the GUI.
            GeneralToolkit.EditorStart(serializedObject, _targetObject);

            // Enable the user to select the source data directory.
            GeneralToolkit.EditorNewSection("Source data");
            SectionDataDirectory(_targetObject);

            // Enable the user to perform 3D reconstruction and simplification using external tools.
            GeneralToolkit.EditorNewSection("External processing helpers");
            SectionExternalTools();

            // Enable the user to process the source data to create Unity assets and compress these assets into an asset bundle.
            GeneralToolkit.EditorNewSection("Data processing");
            SectionProcessingMethods();
            SectionProcessAndBundle();

            // End the GUI.
            GeneralToolkit.EditorEnd(serializedObject);
        }
        /// <summary>
        /// Displays a GUI enabling the user to modify various acquisition parameters.
        /// </summary>
        public override void OnInspectorGUI()
        {
            // Start the GUI.
            GeneralToolkit.EditorStart(serializedObject, _targetObject);

            // Start a change check.
            EditorGUI.BeginChangeCheck();

            // Enable the user to define the acquisition setup.
            GeneralToolkit.EditorNewSection("Acquisition setup");
            SectionSetup();
            // Enable the user to define the source camera parameters.
            GeneralToolkit.EditorNewSection("Camera parameters");
            SectionCameraParameters();
            // Enable the user to define whether geometric data is to be captured.
            GeneralToolkit.EditorNewSection("Geometry acquisition");
            SectionGeometry();

            // End the change check. If any of the previous parameters have changed, the preview window should be updated.
            bool shouldUpdatePreview = EditorGUI.EndChangeCheck();

            // Enable the user to define where to store the captured data.
            GeneralToolkit.EditorNewSection("Output data directory");
            SectionDataDirectory();
            // Provide the user with a button to launch the acquisition process.
            GeneralToolkit.EditorNewSection("Acquire data");
            SectionAcquire();

            // End the GUI.
            GeneralToolkit.EditorEnd(serializedObject);

            // Inform the target object to update the displayed preview information if necessary.
            if (shouldUpdatePreview)
            {
                _targetObject.ComputeAcquisitionCameraPoses();
                _targetObject.UpdatePreviewCameraModel(false);
                SceneView.RepaintAll();
            }
        }