Пример #1
0
        public override bool Inspect()
        {
            var m = MeshMGMT;

            "OnClick:".write(60);
            if ((_mergeUnMerge ? "Merging (Shift: Unmerge)" : "Smoothing (Shift: Unsmoothing)").Click().nl())
            {
                _mergeUnMerge = !_mergeUnMerge;
            }

            if ("Sharp All".Click())
            {
                foreach (MeshPoint vr in EditedMesh.meshPoints)
                {
                    vr.smoothNormal = false;
                }
                EditedMesh.Dirty      = true;
                Cfg.newVerticesSmooth = false;
            }

            if ("Smooth All".Click().nl())
            {
                foreach (var vr in EditedMesh.meshPoints)
                {
                    vr.smoothNormal = true;
                }
                EditedMesh.Dirty      = true;
                Cfg.newVerticesSmooth = true;
            }


            if ("All shared".Click())
            {
                EditedMesh.AllVerticesShared();
                EditedMesh.Dirty      = true;
                Cfg.newVerticesUnique = false;
            }

            if ("All unique".Click().nl())
            {
                foreach (var t in EditedMesh.triangles)
                {
                    EditedMesh.GiveTriangleUniqueVertices(t);
                }
                Cfg.newVerticesUnique = true;
            }



            return(false);
        }
Пример #2
0
        public override bool MouseEventPointedTriangle()
        {
            if (EditorInputManager.GetMouseButton(0))
            {
                if (_mergeUnMerge)
                {
                    if (EditorInputManager.Shift)
                    {
                        EditedMesh.SetAllVerticesShared(PointedTriangle);
                    }
                    else
                    {
                        EditedMesh.GiveTriangleUniqueVertices(PointedTriangle);
                    }
                }
                else
                {
                    EditedMesh.Dirty |= PointedTriangle.SetSmoothVertices(!EditorInputManager.Shift);
                }
            }

            return(false);
        }