예제 #1
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("ProBuilderize Options", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("When Preserve Faces is enabled ProBuilder will try to group adjacent triangles into faces.", MessageType.Info);

            EditorGUI.BeginChangeCheck();

            m_Quads.value     = EditorGUILayout.Toggle(m_QuadsTooltip, m_Quads);
            m_Smoothing.value = EditorGUILayout.Toggle(m_SmoothingTooltip, m_Smoothing);
            GUI.enabled       = m_Smoothing;
            EditorGUILayout.PrefixLabel(m_SmoothingThresholdTooltip);
            m_SmoothingAngle.value = EditorGUILayout.Slider(m_SmoothingAngle, 0.0001f, 45f);

            GUI.enabled = true;

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            GUI.enabled = enabled;

            if (GUILayout.Button("ProBuilderize"))
            {
                EditorUtility.ShowNotification(DoAction().notification);
            }

            GUI.enabled = true;
        }
예제 #2
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Bevel Edge Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Amount determines how much space the bevel occupies. The value is clamped to the size of the smallest affected face.", MessageType.Info);

            EditorGUI.BeginChangeCheck();

            m_BevelSize.value = EditorGUILayout.FloatField(gc_BevelDistance, m_BevelSize);

            if (m_BevelSize < k_MinBevelDistance)
            {
                m_BevelSize.value = k_MinBevelDistance;
            }

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Bevel Edges"))
            {
                DoAction();
            }
        }
예제 #3
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Bevel Edge Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Amount determines how much space the bevel takes up.  Bigger value means more bevel action.", MessageType.Info);

            EditorGUI.BeginChangeCheck();

            m_BevelSize.value = UI.EditorGUIUtility.FreeSlider("Distance", m_BevelSize, .001f, .99f);

            if (m_BevelSize < .001f)
            {
                m_BevelSize.value = .001f;
            }

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Bevel Edges"))
            {
                DoAction();
            }
        }
예제 #4
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Extrude Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Extrude Amount determines how far a face will be moved along it's normal when extruding.  This value can be negative.\n\nYou may also choose to Extrude by Face Normal, Vertex Normal, or as Individual Faces.", MessageType.Info);

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label(m_Icons[(int)extrudeMethod]);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            EditorGUI.BeginChangeCheck();

            extrudeMethod           = (ExtrudeMethod)EditorGUILayout.EnumPopup("Extrude By", extrudeMethod);
            m_ExtrudeDistance.value = EditorGUILayout.FloatField("Distance", m_ExtrudeDistance);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Extrude Faces"))
            {
                PerformAction();
            }
        }
예제 #5
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Subdivide Edge Settings", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.HelpBox("How many vertices to insert on each selected edge.\n\nVertices will be equally spaced between one another and the boundaries of the edge.", MessageType.Info);
            int  minUIRange = m_SubdivisionUIMin.value;
            int  maxUIRange = m_SubdivisionUIMax.value;
            bool expanded   = m_SubdivisionRangeExpanded.value;

            m_SubdivisionCount.value         = (int)UI.EditorGUIUtility.FreeSliderWithRange("Subdivisions", (int)m_SubdivisionCount.value, m_SubdivisionMin, m_SubdivisionMax, ref minUIRange, ref maxUIRange, ref expanded);
            m_SubdivisionUIMin.value         = minUIRange;
            m_SubdivisionUIMax.value         = maxUIRange;
            m_SubdivisionRangeExpanded.value = expanded;


            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Subdivide Edges"))
            {
                PerformAction();
            }
        }
예제 #6
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Export Settings", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            EditorGUI.BeginChangeCheck();
            m_ExportFormat.value = (ExportFormat)EditorGUILayout.EnumPopup(gc_ExportFormat, m_ExportFormat);
            if (EditorGUI.EndChangeCheck())
            {
                if (m_ExportFormat.value == ExportFormat.Asset || m_ExportFormat.value == ExportFormat.Prefab)
                {
                    var opt = ExportAsset.s_ExportAssetOptions.value;
                    opt.makePrefab = m_ExportFormat.value == ExportFormat.Prefab;
                    ExportAsset.s_ExportAssetOptions.SetValue(opt);
                }
            }

            m_ExportRecursive.value = EditorGUILayout.Toggle(gc_ExportRecursive, m_ExportRecursive);

            if (m_ExportFormat != ExportFormat.Asset &&
                m_ExportFormat != ExportFormat.Prefab &&
                m_ExportFormat != ExportFormat.Stl)
            {
                m_ExportAsGroup.value = EditorGUILayout.Toggle(gc_ExportAsGroup, m_ExportAsGroup);
            }

            if (m_ExportFormat == ExportFormat.Obj)
            {
                ObjExportOptions();
            }
            else if (m_ExportFormat == ExportFormat.Stl)
            {
                StlExportOptions();
            }
            else if (m_ExportFormat == ExportFormat.Ply)
            {
                PlyExportOptions();
            }
            else if (m_ExportFormat == ExportFormat.Asset || m_ExportFormat == ExportFormat.Prefab)
            {
                AssetExportOptions();
            }

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Export"))
            {
                EditorUtility.ShowNotification(DoAction().notification);
            }
        }
예제 #7
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Select Ring Edge Options", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();
            m_SelectIterative.value = EditorGUILayout.Toggle(gc_selectIterative, m_SelectIterative);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Select Edge Ring"))
            {
                PerformAction();
                SceneView.RepaintAll();
            }
        }
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Select by Vertex Color Options", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();
            m_SearchSelectedObjectsOnly.value = EditorGUILayout.Toggle(gc_restrictToSelection, m_SearchSelectedObjectsOnly);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Select Vertex Color"))
            {
                DoAction();
                SceneView.RepaintAll();
            }
        }
예제 #9
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Export Settings", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            m_ExportFormat.value = (ExportFormat)EditorGUILayout.EnumPopup(gc_ExportFormat, m_ExportFormat);

            m_ExportRecursive.value = EditorGUILayout.Toggle(gc_ExportRecursive, m_ExportRecursive);

            if (m_ExportFormat != ExportFormat.Asset &&
                m_ExportFormat != ExportFormat.Stl)
            {
                m_ExportAsGroup.value = EditorGUILayout.Toggle(gc_ExportAsGroup, m_ExportAsGroup);
            }

            if (m_ExportFormat == ExportFormat.Obj)
            {
                ObjExportOptions();
            }
            else if (m_ExportFormat == ExportFormat.Stl)
            {
                StlExportOptions();
            }
            else if (m_ExportFormat == ExportFormat.Ply)
            {
                PlyExportOptions();
            }

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Export"))
            {
                DoAction();
            }
        }
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Select Material Options", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            m_RestrictToSelectedObjects.value = EditorGUILayout.Toggle(gc_restrictToSelection, m_RestrictToSelectedObjects);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Select Faces with Material"))
            {
                DoAction();
                SceneView.RepaintAll();
            }
        }
예제 #11
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Detach Face Settings", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            m_DetachSetting.value = EditorGUILayout.Toggle("Separate GameObject", m_DetachSetting.value == DetachSetting.GameObject)
                ? DetachSetting.GameObject
                : DetachSetting.Submesh;

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Detach Selection"))
            {
                EditorUtility.ShowNotification(PerformAction().notification);
            }
        }
예제 #12
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Duplicate Face Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("You can create a new Game Object with the selected face(s), or keep them as part of this object by using a Submesh.", MessageType.Info);

            EditorGUI.BeginChangeCheck();

            m_DuplicateFaceSetting.value = (DuplicateFaceSetting)EditorGUILayout.EnumPopup("Duplicate To", m_DuplicateFaceSetting);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Duplicate Selection"))
            {
                EditorUtility.ShowNotification(PerformAction().notification);
            }
        }
예제 #13
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Fill Hole Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Fill Hole can optionally fill entire holes (default) or just the selected vertices on the hole edges.\n\nIf no elements are selected, the entire object will be scanned for holes.", MessageType.Info);

            EditorGUI.BeginChangeCheck();

            m_SelectEntirePath.value = EditorGUILayout.Toggle("Fill Entire Hole", m_SelectEntirePath);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Fill Hole"))
            {
                EditorUtility.ShowNotification(PerformAction().notification);
            }
        }
예제 #14
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Detach Face Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Detach Faces can separate the selection into either a new GameObject or a submesh.", MessageType.Info);

            EditorGUI.BeginChangeCheck();

            m_DetachSetting.value = (DetachSetting)EditorGUILayout.EnumPopup("Detach To", m_DetachSetting);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Detach Selection"))
            {
                EditorUtility.ShowNotification(PerformAction().notification);
            }
        }
예제 #15
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Subdivide Edge Settings", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.HelpBox("How many vertices to insert on each selected edge.\n\nVertices will be equally spaced between one another and the boundaries of the edge.", MessageType.Info);

            m_SubdivisionCount.value = (int)UI.EditorGUIUtility.FreeSlider("Subdivisions", m_SubdivisionCount, 1, 32);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Subdivide Edges"))
            {
                DoAction();
            }
        }
예제 #16
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Collapse Vertices Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Collapse To First setting decides where the collapsed vertex will be placed.\n\nIf True, the new vertex will be placed at the position of the first selected vertex.  If false, the new vertex is placed at the average position of all selected vertices.", MessageType.Info);

            EditorGUI.BeginChangeCheck();

            m_CollapseToFirst.value = EditorGUILayout.Toggle("Collapse To First", m_CollapseToFirst);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Collapse Vertices"))
            {
                DoAction();
            }
        }
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Grow Selection Options", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            m_GrowSelectionWithAngle.value = EditorGUILayout.Toggle("Restrict to Angle", m_GrowSelectionWithAngle.value);

            GUI.enabled = m_GrowSelectionWithAngle;

            m_GrowSelectionAngleValue.value = EditorGUILayout.FloatField("Max Angle", m_GrowSelectionAngleValue);

            GUI.enabled = m_GrowSelectionWithAngle;

            bool iterative = m_GrowSelectionWithAngle ? m_GrowSelectionAngleIterative : true;

            EditorGUI.BeginChangeCheck();
            iterative = EditorGUILayout.Toggle("Iterative", iterative);
            if (EditorGUI.EndChangeCheck())
            {
                m_GrowSelectionAngleIterative.value = iterative;
            }

            GUI.enabled = true;

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Grow Selection"))
            {
                DoAction();
            }
        }
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Weld Settings", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            m_WeldDistance.value = EditorGUILayout.FloatField(gc_weldDistance, m_WeldDistance);

            if (EditorGUI.EndChangeCheck())
            {
                if (m_WeldDistance < k_MinWeldDistance)
                {
                    m_WeldDistance.value = k_MinWeldDistance;
                }
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Weld Vertices"))
            {
                PerformAction();
            }
        }
예제 #19
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Extrude Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Extrude Amount determines how far an edge will be moved along it's normal when extruding.  This value can be negative.\n\nExtrude as Group determines whether or not adjacent faces stay attached to one another when extruding.", MessageType.Info);

            EditorGUI.BeginChangeCheck();

            VertexManipulationTool.s_ExtrudeEdgesAsGroup.value = EditorGUILayout.Toggle("As Group", VertexManipulationTool.s_ExtrudeEdgesAsGroup);

            m_ExtrudeEdgeDistance.value = EditorGUILayout.FloatField("Distance", m_ExtrudeEdgeDistance);

            if (EditorGUI.EndChangeCheck())
            {
                ProBuilderSettings.Save();
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Extrude Edges"))
            {
                PerformAction();
            }
        }