Beispiel #1
0
 public void LoadVmdFile(string source_file)
 {
     Console.WriteLine("loading {0}", source_file);
     vmd = new VmdFile();
     vmd.Load(source_file);
     UpdateNodemap();
     UpdateSkinmap();
     this.frame_index = 0;
     UpdatePose(frame_index);
     UpdateSkinBase();
     UpdateSkin(frame_index);
     SolveIK();
     UpdateBoneMatrices();
     pmd.RewriteVertexBuffer(device);
     control.Invalidate();
 }
Beispiel #2
0
        public VmdFile GenerateVmd()
        {
            VmdFile vmd = new VmdFile();

            int node_count = nodes.Length;

            vmd.nodes = new VmdNode[node_count];

            for (ushort i = 0; i < node_count; i++)
            {
                vmd.nodes[i]                = new VmdNode(i);
                vmd.nodes[i].name           = nodes[i].name;
                vmd.nodes[i].parent_node_id = nodes[i].parent_node_id;
                VmdMat mat = new VmdMat();
                vmd.nodes[i].matrices = new VmdMat[] { mat };
            }

            vmd.GenerateNodemapAndTree();

            return(vmd);
        }