Пример #1
0
        protected void GUI_Camera()
        {
            EditorGUILayout.PropertyField(_propCamera);

            EditorUtils.EnumAsDropdown("Resolution", _propRenderResolution, CaptureBaseEditor.ResolutionStrings);

            if (_propRenderResolution.enumValueIndex == (int)CaptureBase.Resolution.Custom)
            {
                EditorGUILayout.PropertyField(_propRenderSize, new GUIContent("Size"));
                _propRenderSize.vector2Value = new Vector2(Mathf.Clamp((int)_propRenderSize.vector2Value.x, 1, NativePlugin.MaxRenderWidth), Mathf.Clamp((int)_propRenderSize.vector2Value.y, 1, NativePlugin.MaxRenderHeight));
            }
            {
                string currentAA = "None";
                if (QualitySettings.antiAliasing > 1)
                {
                    currentAA = QualitySettings.antiAliasing.ToString() + "x";
                }
                EditorUtils.IntAsDropdown("Anti-aliasing", _propAntiAliasing, new string[] { "Current (" + currentAA + ")", "None", "2x", "4x", "8x" }, new int[] { -1, 1, 2, 4, 8 });
            }

            EditorUtils.IntAsDropdown("Cubemap Resolution", _propCubemapResolution, new string[] { "256", "512", "1024", "2048", "4096", "8192" }, new int[] { 256, 512, 1024, 2048, 4096, 8192 });
            EditorUtils.IntAsDropdown("Cubemap Depth", _propCubemapDepth, new string[] { "0", "16", "24" }, new int[] { 0, 16, 24 });
            EditorGUILayout.PropertyField(_propSupportGUI, new GUIContent("Capture GUI"));
            EditorGUILayout.PropertyField(_propSupporCameraRotation);
            EditorGUILayout.PropertyField(_propRender180Degrees);
            EditorGUILayout.PropertyField(_propStereoRendering);
            if (_propStereoRendering.enumValueIndex != (int)StereoPacking.None)
            {
                EditorGUILayout.PropertyField(_propIPD, new GUIContent("Interpupillary distance"));
            }
        }
Пример #2
0
        protected void GUI_Camera()
        {
            EditorGUILayout.PropertyField(_propCamera);

            EditorUtils.EnumAsDropdown("Resolution", _propRenderResolution, CaptureBaseEditor.ResolutionStrings);

            if (_propRenderResolution.enumValueIndex == (int)CaptureBase.Resolution.Custom)
            {
                EditorGUILayout.PropertyField(_propRenderSize, new GUIContent("Size"));
                _propRenderSize.vector2Value = new Vector2(Mathf.Clamp((int)_propRenderSize.vector2Value.x, 1, NativePlugin.MaxRenderWidth), Mathf.Clamp((int)_propRenderSize.vector2Value.y, 1, NativePlugin.MaxRenderHeight));
            }

            {
                string currentAA = "None";
                if (QualitySettings.antiAliasing > 1)
                {
                    currentAA = QualitySettings.antiAliasing.ToString() + "x";
                }
                EditorUtils.IntAsDropdown("Anti-aliasing", _propAntiAliasing, new string[] { "Current (" + currentAA + ")", "None", "2x", "4x", "8x" }, new int[] { -1, 1, 2, 4, 8 });
            }

            EditorGUILayout.Space();

            EditorGUILayout.PropertyField(_propRender180Degrees);
            EditorGUILayout.PropertyField(_propIPD, new GUIContent("Interpupillary distance"));
            EditorGUILayout.PropertyField(_propPixelSliceSize);
            EditorGUILayout.PropertyField(_propPaddingSize);
            EditorGUILayout.PropertyField(_propCameraClearMode);
            EditorGUILayout.PropertyField(_propCameraClearColor);
            EditorGUILayout.PropertyField(_propCameraImageEffects, true);
        }
        protected void GUI_Camera()
        {
            EditorGUILayout.PropertyField(_propCameraSelector);

            if (null == _propCameraSelector.objectReferenceValue)
            {
                EditorGUILayout.PropertyField(_propCamera);
            }

            EditorUtils.EnumAsDropdown("Resolution", _propRenderResolution, CaptureBaseEditor.ResolutionStrings);

            if (_propRenderResolution.enumValueIndex == (int)CaptureBase.Resolution.Custom)
            {
                EditorGUILayout.PropertyField(_propRenderSize, new GUIContent("Size"));
                _propRenderSize.vector2Value = new Vector2(Mathf.Clamp((int)_propRenderSize.vector2Value.x, 1, NativePlugin.MaxRenderWidth), Mathf.Clamp((int)_propRenderSize.vector2Value.y, 1, NativePlugin.MaxRenderHeight));
            }
            {
                string currentAA = "None";
                if (QualitySettings.antiAliasing > 1)
                {
                    currentAA = QualitySettings.antiAliasing.ToString() + "x";
                }
                EditorUtils.IntAsDropdown("Anti-aliasing", _propAntiAliasing, new string[] { "Current (" + currentAA + ")", "None", "2x", "4x", "8x" }, new int[] { -1, 1, 2, 4, 8 });
            }

            EditorUtils.IntAsDropdown("Cubemap Resolution", _propCubemapResolution, new string[] { "256", "512", "1024", "2048", "4096", "8192" }, new int[] { 256, 512, 1024, 2048, 4096, 8192 });
            EditorUtils.IntAsDropdown("Cubemap Depth", _propCubemapDepth, new string[] { "0", "16", "24" }, new int[] { 0, 16, 24 });
            EditorGUILayout.PropertyField(_propSupportGUI, new GUIContent("Capture GUI"));
            EditorGUILayout.PropertyField(_propSupporCameraRotation, new GUIContent("Camera Rotation"));
            if (_propSupporCameraRotation.boolValue)
            {
                EditorGUILayout.PropertyField(_propOnlyLeftRightRotation);
            }
            EditorGUILayout.PropertyField(_propRender180Degrees);
            EditorGUILayout.PropertyField(_propStereoRendering);
            if (_propStereoRendering.enumValueIndex != (int)StereoPacking.None)
            {
                                #if AVPRO_MOVIECAPTURE_UNITY_STEREOCUBEMAP_RENDER
                if (!PlayerSettings.enable360StereoCapture)
                {
                    ShowNoticeBox(MessageType.Warning, "360 Stereo Capture needs to be enabled in PlayerSettings");
                    if (GUILayout.Button("Enable 360 Stereo Capture"))
                    {
                        PlayerSettings.enable360StereoCapture = true;
                    }
                }
                                #endif
                // TODO: detect HDRP and warn that stereo capture is not supported
                EditorGUILayout.PropertyField(_propIPD, new GUIContent("Interpupillary distance"));
            }
        }
Пример #4
0
        protected void GUI_Visual()
        {
            EditorGUILayout.PropertyField(_propDownScale);
            if (_propDownScale.enumValueIndex == 5)
            {
                EditorGUILayout.PropertyField(_propMaxVideoSize, new GUIContent("Size"));
                _propMaxVideoSize.vector2Value = new Vector2(Mathf.Clamp((int)_propMaxVideoSize.vector2Value.x, 1, NativePlugin.MaxRenderWidth), Mathf.Clamp((int)_propMaxVideoSize.vector2Value.y, 1, NativePlugin.MaxRenderHeight));
            }
            EditorUtils.EnumAsDropdown("Frame Rate", _propFrameRate, new string[] { "1", "10", "15", "24", "25", "30", "50", "60", "75", "90", "120" });

            EditorGUI.BeginDisabledGroup(!_propIsRealtime.boolValue);
            EditorGUILayout.PropertyField(_propTimelapseScale);
            _propTimelapseScale.intValue = Mathf.Max(1, _propTimelapseScale.intValue);
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.PropertyField(_propFlipVertically);
            EditorGUILayout.PropertyField(_propSupportAlpha);

            EditorGUILayout.Space();

            EditorGUI.BeginDisabledGroup(_propOutputType.enumValueIndex != (int)CaptureBase.OutputType.VideoFile);
            GUILayout.Label("Codecs", EditorStyles.boldLabel);
            if (_propOutputType.enumValueIndex == (int)CaptureBase.OutputType.VideoFile)
            {
                GUI_VisualCodecs();
            }
            else
            {
                GUI.color = Color.yellow;
                GUILayout.TextArea("Codec selection only available when video file output");
                GUI.color = Color.white;
            }
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Space();

            EditorGUI.BeginDisabledGroup(_propIsRealtime.boolValue);
            GUILayout.Label("Motion Blur", EditorStyles.boldLabel);
            if (_propIsRealtime.boolValue)
            {
                GUI.color = Color.yellow;
                GUILayout.TextArea("Motion Blur only available in Offline Render mode");
                GUI.color = Color.white;
            }
            else
            {
                GUI_MotionBlur();
            }
            EditorGUI.EndDisabledGroup();
        }
        protected void GUI_Camera()
        {
            Camera prevLastCamera = (Camera)_propLastCamera.objectReferenceValue;

            EditorGUILayout.PropertyField(_propLastCamera, new GUIContent("Camera", "The top level camera you want to capture"));

            Camera lastCamera = (Camera)_propLastCamera.objectReferenceValue;

            // If the user has changed the camera, reset the contributing cameras
            if (lastCamera != prevLastCamera)
            {
                _propContribCameras.arraySize = 0;
            }

            _propUseContribCameras.boolValue = EditorGUILayout.ToggleLeft("Use Contributing Cameras", _propUseContribCameras.boolValue);

            if (lastCamera != null && _propUseContribCameras.boolValue)
            {
                if (Utils.HasContributingCameras(lastCamera))
                {
                    if (GUILayout.Button("Find Contributing Cameras", EditorStyles.miniButtonRight, GUILayout.ExpandWidth(false)))
                    {
                        Camera[] cameras = Utils.FindContributingCameras(lastCamera);
                        if (cameras != null && cameras.Length > 0)
                        {
                            _propContribCameras.arraySize = cameras.Length;
                            for (int slotIndex = 0; slotIndex < cameras.Length; slotIndex++)
                            {
                                _propContribCameras.GetArrayElementAtIndex(slotIndex).objectReferenceValue = cameras[slotIndex];
                            }
                        }
                        else
                        {
                            _propContribCameras.arraySize = 0;
                        }
                    }
                }

                if (_propUseContribCameras.boolValue)
                {
                    EditorGUILayout.PropertyField(_propContribCameras, new GUIContent("Contributing Cameras", "Cameras in render order from first to last that contribute to the rendering of the main camera above"), true);
                }
            }

            EditorGUILayout.Space();

            EditorUtils.EnumAsDropdown("Resolution", _propRenderResolution, CaptureBaseEditor.ResolutionStrings);

            if (_propRenderResolution.enumValueIndex == (int)CaptureBase.Resolution.Custom)
            {
                EditorGUILayout.PropertyField(_propRenderSize, new GUIContent("Size"));
                _propRenderSize.vector2Value = new Vector2(Mathf.Clamp((int)_propRenderSize.vector2Value.x, 1, NativePlugin.MaxRenderWidth), Mathf.Clamp((int)_propRenderSize.vector2Value.y, 1, NativePlugin.MaxRenderHeight));
            }
            {
                string currentAA = "None";
                if (QualitySettings.antiAliasing > 1)
                {
                    currentAA = QualitySettings.antiAliasing.ToString() + "x";
                }
                EditorUtils.IntAsDropdown("Anti-aliasing", _propAntiAliasing, new string[] { "Current (" + currentAA + ")", "None", "2x", "4x", "8x" }, new int[] { -1, 1, 2, 4, 8 });
            }
        }
Пример #6
0
        protected void GUI_OutputFilePath()
        {
            EditorUtils.EnumAsDropdown("Output Type", _propOutputType, new string[] { "Video File", "Image Sequence", "Named Pipe" });
            if (_propOutputType.enumValueIndex == (int)CaptureBase.OutputType.VideoFile ||
                _propOutputType.enumValueIndex == (int)CaptureBase.OutputType.ImageSequence)
            {
                bool isImageSequence = (_propOutputType.enumValueIndex == (int)CaptureBase.OutputType.ImageSequence);

                if (isImageSequence)
                {
                    EditorUtils.EnumAsDropdown("Format", _propImageSequenceFormat, new string[] { "PNG (uncompressed)" });
                    GUILayout.Space(8f);
                }

                GUILayout.Label("Folder", EditorStyles.boldLabel);
                EditorGUILayout.PropertyField(_propOutputFolderType, new GUIContent("Folder"));
                if (_propOutputFolderType.enumValueIndex == (int)CaptureBase.OutputPath.Absolute)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(_propOutputFolderPath, new GUIContent("Path"));
                    if (GUILayout.Button(">", GUILayout.Width(22)))
                    {
                        _propOutputFolderPath.stringValue = EditorUtility.SaveFolderPanel("Select Folder To Store Video Captures", System.IO.Path.GetFullPath(System.IO.Path.Combine(Application.dataPath, "../")), "");
                    }
                    EditorGUILayout.EndHorizontal();
                }
                else
                {
                    EditorGUILayout.PropertyField(_propOutputFolderPath, new GUIContent("Subfolder(s)"));
                }

                GUILayout.Label("File Name", EditorStyles.boldLabel);

                if (!isImageSequence)
                {
                    EditorGUILayout.PropertyField(_propAutoGenerateFileName, new GUIContent("Auto Generate"));
                    if (_propAutoGenerateFileName.boolValue)
                    {
                        EditorGUILayout.PropertyField(_propAutoFileNamePrefix, new GUIContent("Prefix"));
                        EditorGUILayout.PropertyField(_propFileNameExtension, new GUIContent("Extension"));
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(_propForceFileName, new GUIContent("File Name"));
                    }
                }

                if (isImageSequence)
                {
                    EditorGUILayout.PropertyField(_propAutoFileNamePrefix, new GUIContent("Prefix"));
                    EditorGUILayout.PropertyField(_propImageSequenceStartFrame, new GUIContent("Start Frame"));
                    EditorGUILayout.PropertyField(_propImageSequenceZeroDigits, new GUIContent("Zero Digits"));
                }
            }
            else
            {
                EditorGUILayout.PropertyField(_propForceFileName, new GUIContent("Pipe Path"));
            }


            /*// File path
             * EditorGUILayout.LabelField("File Path", EditorStyles.boldLabel);
             * EditorGUI.indentLevel++;
             * _outputFolderIndex = EditorGUILayout.Popup("Relative to", _outputFolderIndex, _outputFolders);
             * if (_outputFolderIndex == 0 || _outputFolderIndex == 1)
             * {
             *      _outputFolderRelative = EditorGUILayout.TextField("SubFolder(s)", _outputFolderRelative);
             * }
             * else
             * {
             *      EditorGUILayout.BeginHorizontal();
             *      _outputFolderAbsolute = EditorGUILayout.TextField("Path", _outputFolderAbsolute);
             *      if (GUILayout.Button(">", GUILayout.Width(22)))
             *      {
             *              _outputFolderAbsolute = EditorUtility.SaveFolderPanel("Select Folder To Store Video Captures", System.IO.Path.GetFullPath(System.IO.Path.Combine(Application.dataPath, "../")), "");
             *              EditorUtility.SetDirty(this);
             *      }
             *      EditorGUILayout.EndHorizontal();
             * }
             * EditorGUI.indentLevel--;*/
        }
Пример #7
0
        protected void GUI_Camera()
        {
            Camera prevLastCamera = null, lastCamera = null;

            EditorGUILayout.PropertyField(_propCameraSelector);

            if (null == _propCameraSelector.objectReferenceValue)
            {
                prevLastCamera = (Camera)_propLastCamera.objectReferenceValue;

                EditorGUILayout.PropertyField(_propLastCamera, _guiItemCamera);

                lastCamera = (Camera)_propLastCamera.objectReferenceValue;
            }

            // If the user has changed the camera, reset the contributing cameras
            if (lastCamera != prevLastCamera)
            {
                _propContribCameras.arraySize = 0;
                if (lastCamera == null)
                {
                    _propUseContribCameras.boolValue = false;
                }
            }

            _propUseContribCameras.boolValue = EditorGUILayout.ToggleLeft("Use Contributing Cameras", _propUseContribCameras.boolValue);

            if (lastCamera != null)
            {
                if (_propUseContribCameras.boolValue)
                {
                    if (GUILayout.Button("Find Contributing Cameras", EditorStyles.miniButtonRight, GUILayout.ExpandWidth(false)))
                    {
                        bool hasContribCameras = false;
                        if (Utils.HasContributingCameras(lastCamera))
                        {
                            Camera[] cameras = Utils.FindContributingCameras(lastCamera);
                            if (cameras != null && cameras.Length > 0)
                            {
                                hasContribCameras             = true;
                                _propContribCameras.arraySize = cameras.Length;
                                for (int slotIndex = 0; slotIndex < cameras.Length; slotIndex++)
                                {
                                    _propContribCameras.GetArrayElementAtIndex(slotIndex).objectReferenceValue = cameras[slotIndex];
                                }
                            }
                        }

                        if (!hasContribCameras)
                        {
                            _propContribCameras.arraySize    = 0;
                            _propUseContribCameras.boolValue = false;
                        }
                    }

                    EditorGUILayout.PropertyField(_propContribCameras, _guiItemContribCamera, true);
                    EditorGUILayout.Space();
                }
            }

            EditorUtils.EnumAsDropdown("Resolution", _propRenderResolution, CaptureBaseEditor.ResolutionStrings);

            if (_propRenderResolution.enumValueIndex == (int)CaptureBase.Resolution.Custom)
            {
                EditorGUILayout.PropertyField(_propRenderSize, new GUIContent("Size"));
                _propRenderSize.vector2Value = new Vector2(Mathf.Clamp((int)_propRenderSize.vector2Value.x, 1, NativePlugin.MaxRenderWidth), Mathf.Clamp((int)_propRenderSize.vector2Value.y, 1, NativePlugin.MaxRenderHeight));
            }
            {
                string currentAA = "None";
                if (QualitySettings.antiAliasing > 1)
                {
                    currentAA = QualitySettings.antiAliasing.ToString() + "x";
                }
                EditorUtils.IntAsDropdown("Anti-aliasing", _propAntiAliasing, new string[] { "Current (" + currentAA + ")", "None", "2x", "4x", "8x" }, new int[] { -1, 1, 2, 4, 8 });
            }

#if SUPPORT_SCENE_VIEW_GIZMOS_CAPTURE
            EditorGUILayout.PropertyField(_propIncludeSceneViewGizmos);
#endif
        }