Exemplo n.º 1
0
        public void FillSkeleton(SuperBMDLib.BMD.INF1 INF1, STSkeleton skeleton, List <SuperBMDLib.Rigging.Bone> flatSkeleton)
        {
            for (int i = 1; i < INF1.FlatNodes.Count; i++)
            {
                SuperBMDLib.Scenegraph.SceneNode curNode = INF1.FlatNodes[i];

                if (curNode.Type == SuperBMDLib.Scenegraph.Enums.NodeType.Joint)
                {
                    var Bone = flatSkeleton[curNode.Index];

                    var stBone = new STBone(skeleton);
                    stBone.Text = Bone.Name;
                    stBone.FromTransform(Bone.TransformationMatrix);

                    if (Bone.Parent != null)
                    {
                        stBone.parentIndex = flatSkeleton.IndexOf(Bone.Parent);
                    }
                    else
                    {
                        stBone.parentIndex = -1;
                    }

                    skeleton.bones.Add(stBone);
                }
            }
        }
Exemplo n.º 2
0
 public void CorrectMaterialIndices(List <GenericRenderedObject> Meshes, SuperBMDLib.BMD.INF1 INF1, SuperBMDLib.BMD.MAT3 materials)
 {
     foreach (SuperBMDLib.Scenegraph.SceneNode node in INF1.FlatNodes)
     {
         if (node.Type == SuperBMDLib.Scenegraph.Enums.NodeType.Shape)
         {
             if (node.Index < Meshes.Count)
             {
                 int matIndex = node.Parent.Index;
                 ((BMDShapeWrapper)Meshes[node.Index]).SetMaterial((STGenericMaterial)MaterialFolder.Nodes[matIndex]);
             }
         }
     }
 }