Ejemplo n.º 1
0
        public bool Execute()
        {
            foreach (MqoVert v in mqo_mesh.vertices)
            {
                FindWeight(v);
            }
            foreach (MqoVert v in mqo_mesh.vertices)
            {
                if (v.selected)
                {
                    SmoothWeight(v);
                }
            }
            bool updated = false;

            foreach (MqoVert v in mqo_mesh.vertices)
            {
                if (v.selected)
                {
                    VertexCommand vertex_command = new VertexCommand(tso, selected_node, v, new_weits[v.Index], WeightOperation.Assign);

                    if (vertex_command.Execute())
                    {
                        v.Update();
                        this.vertex_commands.Add(vertex_command);
                        updated = true;
                    }
                }
            }
            return(updated);
        }
Ejemplo n.º 2
0
        /// 選択ボーンに対応するウェイトを加算する。
        /// returns: ウェイトを変更したか
        public bool Execute()
        {
            bool updated = false;

            foreach (MqoVert v in mqo_mesh.vertices)
            {
                if (v.selected)
                {
                    VertexCommand vertex_command = new VertexCommand(tso, selected_node, v, weight * v.factor, weight_op);

                    if (vertex_command.Execute())
                    {
                        v.Update();
                        this.vertex_commands.Add(vertex_command);
                        updated = true;
                    }
                }
            }
            return(updated);
        }