예제 #1
0
파일: xxEditor.cs 프로젝트: kkdevs/sb3u
        public void CreateSkin(int meshId, object[] skeletons)
        {
            string[]       rootNames      = Utility.Convert <string>(skeletons);
            List <xxFrame> skeletonFrames = new List <xxFrame>(rootNames.Length);

            foreach (string root in rootNames)
            {
                skeletonFrames.Add(Frames[GetFrameId(root)]);
            }
            xx.CreateSkin(Meshes[meshId], skeletonFrames);
            Changed = true;
        }
예제 #2
0
파일: Fbx.cs 프로젝트: ymilv/SB3Utility
        public static void ExportFbx([DefaultVar] xxParser xxParser, object[] meshNames, object[] xaParsers, int startKeyframe, int endKeyframe, bool linear, string path, string exportFormat, bool allFrames, bool skins)
        {
            List <xaParser> xaParserList = null;

            if (xaParsers != null)
            {
                xaParserList = new List <xaParser>(Utility.Convert <xaParser>(xaParsers));
            }

            List <xxFrame> meshFrames = xx.FindMeshFrames(xxParser.Frame, new List <string>(Utility.Convert <string>(meshNames)));

            Fbx.Exporter.Export(path, xxParser, meshFrames, xaParserList, startKeyframe, endKeyframe, linear, exportFormat, allFrames, skins);
        }
예제 #3
0
파일: xxEditor.cs 프로젝트: kkdevs/sb3u
 public void AddBone(int id, object[] meshes)
 {
     string[] meshFrameNames = Utility.Convert <string>(meshes);
     foreach (string meshName in meshFrameNames)
     {
         xxFrame meshFrame = xx.FindFrame(meshName, Parser.Frame);
         if (xx.FindBone(meshFrame.Mesh.BoneList, Frames[id].Name) == null)
         {
             xx.CreateBone(Frames[id], meshFrame.Mesh);
         }
     }
     Changed = true;
 }
예제 #4
0
파일: xxEditor.cs 프로젝트: kkdevs/sb3u
        public void ComputeBoneMatrices(object[] meshNames)
        {
            string[]      meshFrameNames     = Utility.Convert <string>(meshNames);
            List <string> meshFrameNamesList = new List <string>(meshFrameNames.Length);

            foreach (string name in meshFrameNames)
            {
                meshFrameNamesList.Add(name);
            }
            List <xxFrame> meshFrames = xx.FindMeshFrames(Parser.Frame, meshFrameNamesList);

            foreach (xxFrame meshFrame in meshFrames)
            {
                xx.ComputeBoneMatrices(meshFrame.Mesh.BoneList, Parser.Frame);
            }
            Changed = true;
        }
예제 #5
0
파일: Fbx.cs 프로젝트: kkdevs/sb3u
        public static void ExportFbx([DefaultVar] xxParser xxParser, object[] meshNames, object[] xaParsers, int startKeyframe, int endKeyframe, bool linear, bool EulerFilter, double filterPrecision, string path, string exportFormat, bool allFrames, bool skins, bool embedMedia, bool compatibility)
        {
            List <xaParser> xaParserList = null;

            if (xaParsers != null)
            {
                xaParserList = new List <xaParser>(Utility.Convert <xaParser>(xaParsers));
            }

            List <xxFrame> meshFrames = meshNames != null?xx.FindMeshFrames(xxParser.Frame, new List <string>(Utility.Convert <string>(meshNames))) : null;

            if (meshFrames != null && meshFrames.Count == 0)
            {
                meshFrames = null;
            }
            Fbx.Exporter.Export(path, xxParser, meshFrames, xaParserList, startKeyframe, endKeyframe, linear, EulerFilter, (float)filterPrecision, exportFormat, allFrames, skins, embedMedia, compatibility);
        }
예제 #6
0
        public static void ExportMqo([DefaultVar] xxParser parser, object[] meshNames, string dirPath, bool singleMqo, bool worldCoords, bool sortMeshes = true)
        {
            List <xxFrame> meshParents = xx.FindMeshFrames(parser.Frame, new List <string>(Utility.Convert <string>(meshNames)));

            if (sortMeshes)
            {
                meshParents.Sort();
            }
            Mqo.Exporter.Export(dirPath, parser, meshParents, singleMqo, worldCoords);
        }