Exemplo n.º 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"));
            }
        }
Exemplo n.º 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"));
            }
        }
Exemplo n.º 4
0
        protected void GUI_Audio()
        {
            EditorGUI.BeginDisabledGroup(!_propIsRealtime.boolValue || _propOutputType.enumValueIndex != (int)CaptureBase.OutputType.VideoFile);
            if (!_propIsRealtime.boolValue)
            {
                GUI.color = Color.yellow;
                GUILayout.TextArea("Audio Capture only available in Realtime Capture mode");
                GUI.color = Color.white;
            }
            if (_propOutputType.enumValueIndex != (int)CaptureBase.OutputType.VideoFile)
            {
                GUI.color = Color.yellow;
                GUILayout.TextArea("Audio Capture only available for video file output");
                GUI.color = Color.white;
            }

            if (GUI.enabled)
            {
                _propNoAudio.boolValue = !EditorGUILayout.Toggle("Capture Audio", !_propNoAudio.boolValue);
                if (!_propNoAudio.boolValue)
                {
                    EditorUtils.IntAsDropdown("Source", _propForceAudioDeviceIndex, new string[] { "Unity", "System Recording Device" }, new int[] { -1, Mathf.Max(0, _propForceAudioDeviceIndex.intValue) });
                    if (_propForceAudioDeviceIndex.intValue >= 0)
                    {
                        EditorGUILayout.PropertyField(_propForceAudioDeviceIndex);
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(_propUnityAudioCapture);
                    }
                    EditorGUILayout.PropertyField(_propAudioCodecPriority, true);
                    EditorGUILayout.PropertyField(_propForceAudioCodecIndex);
                }
            }
            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 });
            }
        }
Exemplo n.º 6
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
        }