private void ImportSkeleton(string boneArray)
{
if (this.boneMap.Count == 0)
{
Maxscript.NewArray(boneArray);
}
for (int i = 0; i < this.File.Bones.Count; ++i)
{
GrnBone bone = this.File.Bones[i];
if (bone.Name == "__Root")
{
continue;
}
if (this.boneMap.ContainsKey(bone.Name))
{
Maxscript.Command("{0}[{1}].transform = {2}", boneArray, this.boneMap[bone.Name] + 1,
this.GetBoneLocalTransform(bone, "boneTransMat"));
}
else
{
this.boneMap.Add(bone.Name, this.boneMap.Count);
Maxscript.Append(boneArray, this.CreateBone(bone));
}
if (bone.ParentIndex > 0)
{
Maxscript.Command("{0}[{1}].parent = {0}[{2}]", boneArray, this.boneMap[bone.Name] + 1,
this.boneMap[this.File.Bones[bone.ParentIndex].Name] + 1);
Maxscript.Command("{0}[{1}].transform *= {0}[{1}].parent.transform", boneArray, this.boneMap[bone.Name] + 1);
}
}
}