Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            mm.RemoteControl rc = new mm.RemoteControl();
            rc.Initialize();

            // you could import a mesh using this command:
            //sc.AppendSceneCommand_AppendMeshFile(...);

            StoredCommands sc = new StoredCommands();

            // [RMS] select entire mesh
            sc.AppendBeginToolCommand("select");
            sc.AppendSelectCommand_All();
            // [RMS] start remesh tool
            sc.AppendBeginToolCommand("remesh");
            // [RMS] configure parameters
            sc.AppendToolParameterCommand("density", 0.2f);
            sc.AppendToolParameterCommand("smooth", 1.0f);
            // [RMS] accept result
            sc.AppendCompleteToolCommand("accept");
            sc.AppendCompleteToolCommand("cancel");     // [RMS] to exit out of selection

            rc.ExecuteCommands(sc);

            // you could export result using this command
            //sc.AppendSceneCommand_ExportMeshFile_CurrentSelection(...);

            rc.Shutdown();
        }
Esempio n. 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            mmapi_util.RemoteControl rc = new mmapi_util.RemoteControl();
            rc.Initialize();

            // you could import a mesh using this command:
            //sc.AppendSceneCommand_AppendMeshFile(...);

            StoredCommands sc = new StoredCommands();
            // [RMS] select entire mesh
            sc.AppendBeginToolCommand("select");
            sc.AppendSelectCommand_All();
            // [RMS] start remesh tool
            sc.AppendBeginToolCommand("remesh");
            // [RMS] configure parameters
            sc.AppendToolParameterCommand("density", 0.2f);
            sc.AppendToolParameterCommand("smooth", 1.0f);
            // [RMS] accept result
            sc.AppendCompleteToolCommand("accept");
            sc.AppendCompleteToolCommand("cancel");     // [RMS] to exit out of selection

            rc.ExecuteCommands(sc);

            // you could export result using this command
            //sc.AppendSceneCommand_ExportMeshFile_CurrentSelection(...);

            rc.Shutdown();
        }
Esempio n. 3
0
        private void smooth_groups_test()
        {
            mm.RemoteControl rc = new mm.RemoteControl();
            rc.Initialize();

            List <int> o  = get_selected_objects(rc);
            int        id = o[0];

            StoredCommands sc   = new StoredCommands();
            uint           key1 = sc.AppendSceneCommand_ListFaceGroups(id);

            rc.ExecuteCommands(sc);
            vectori groupv = new vectori();

            sc.GetSceneCommandResult_ListFaceGroups(key1, groupv);
            var vGroups = groupv.ToList();

            foreach (int g in vGroups)
            {
                StoredCommands cmd = new StoredCommands();
                vectori        v   = new vectori()
                {
                    g
                };
                cmd.AppendSelectCommand_ByFaceGroups(v);
                cmd.AppendBeginToolCommand("smoothBoundary");
                cmd.AppendToolParameterCommand("preserveGroupBorders", false);
                cmd.AppendToolParameterCommand("preserveBoundary", true);
                cmd.AppendCompleteToolCommand("accept");
                cmd.AppendCompleteToolCommand("cancel");
                rc.ExecuteCommands(cmd);
            }

            rc.Shutdown();
        }
Esempio n. 4
0
        private void align_test()
        {
            mm.RemoteControl rc = new mm.RemoteControl();
            rc.Initialize();

            int sourcePivotID = get_object_id(rc, "source_pivot");
            int destPivotID   = get_object_id(rc, "dest_pivot");

            System.Diagnostics.Debug.Assert(sourcePivotID != -1, "scene must have pivot with name source_pivot");
            System.Diagnostics.Debug.Assert(destPivotID != -1, "scene must have pivot with name dest_pivot");

            List <int> selected = get_selected_objects(rc);

            System.Diagnostics.Debug.Assert(selected != null && selected.Count == 1, "the mesh you want to move must be selected");

            StoredCommands sc = new StoredCommands();

            sc.AppendBeginToolCommand("align");
            sc.AppendToolParameterCommand("sourceType", 13);
            sc.AppendToolParameterCommand("targetType", 13);
            sc.AppendToolUtilityCommand("setSourcePivot", sourcePivotID);
            sc.AppendToolUtilityCommand("setDestPivot", destPivotID);
            //sc.AppendToolParameterCommand("flip", true);
            sc.AppendCompleteToolCommand("accept");
        }
Esempio n. 5
0
        public void CompleteTool(string result)
        {
            StoredCommands sc = new StoredCommands();

            sc.AppendCompleteToolCommand(result);
            ExecuteCommands(sc);
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            mmapi_util.RemoteControl rc = new mmapi_util.RemoteControl();
            rc.Initialize();

            StoredCommands sc = new StoredCommands();
            sc.AppendBeginToolCommand("planeCut");
            sc.AppendCompleteToolCommand("accept");

            rc.ExecuteCommands(sc);
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            mmapi_util.RemoteControl rc = new mmapi_util.RemoteControl();
            rc.Initialize();

            StoredCommands sc = new StoredCommands();

            sc.AppendBeginToolCommand("planeCut");
            sc.AppendCompleteToolCommand("accept");

            rc.ExecuteCommands(sc);
        }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            mmapi_util.RemoteControl rc = new mmapi_util.RemoteControl();
            rc.Initialize();

            StoredCommands sc = new StoredCommands();
            sc.AppendBeginToolCommand("planeCut");
            sc.AppendCompleteToolCommand("accept");

            rc.ExecuteCommands(sc);

            rc.Shutdown();
        }
Esempio n. 9
0
        private void button1_Click(object sender, EventArgs e)
        {
            mm.RemoteControl rc = new mm.RemoteControl();
            rc.Initialize();

            StoredCommands sc = new StoredCommands();

            sc.AppendBeginToolCommand("planeCut");
            sc.AppendCompleteToolCommand("accept");

            rc.ExecuteCommands(sc);

            rc.Shutdown();
        }
Esempio n. 10
0
        private void plane_cut_test()
        {
            mm.RemoteControl rc = new mm.RemoteControl();
            rc.Initialize();

            StoredCommands sc = new StoredCommands();

            sc.AppendBeginToolCommand("planeCut");
            sc.AppendCompleteToolCommand("accept");

            rc.ExecuteCommands(sc);

            rc.Shutdown();
        }