コード例 #1
0
        public void ExportSkeletalMeshToFbx(MESkeletalMesh mesh, string meshName, string targetdir)
        {
            FBXManager lSdkManager = new FBXManager();
            FBXScene   lScene      = new FBXScene();

            FBXHelper.InitializeSdkObjects(lSdkManager, lScene);
            FBXNode SceneRoot     = lScene.GetRootNode();
            FBXNode lSkeletonRoot = CreateFbxSkeleton(mesh.Bones, lScene);

            SceneRoot.AddChild(lSkeletonRoot);
            try
            {
                FBXNode fbxMesh = CreateFbxMesh(mesh, meshName, lScene);
                CreateMeshSkinning(mesh, 0, fbxMesh, lSkeletonRoot, lScene);
                SceneRoot.AddChild(fbxMesh);
                //StoreRestPose(lScene, lSkeletonRoot, skeleton);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            bool lResult = FBXHelper.SaveScene(lSdkManager, lScene, targetdir);

            FBXHelper.DestroySdkObjects(lSdkManager, lResult);
        }
コード例 #2
0
ファイル: FBXExporter.cs プロジェクト: gabbyh/MEAExplorerWV
        private bool SaveScene(String targetdir, FBXManager pSdkManager, FBXScene pScene)
        {
            bool lResult = FBXHelper.SaveScene(pSdkManager, pScene, targetdir);

            FBXHelper.DestroySdkObjects(pSdkManager, lResult);
            return(lResult);
        }
コード例 #3
0
        public void ExportMeshWithMorph(Unreal.BioMorphFace morph, int lodIndex, String targetdir)
        {
            FBXManager lSdkManager = new FBXManager();
            FBXScene   lScene      = new FBXScene();

            FBXHelper.InitializeSdkObjects(lSdkManager, lScene);
            FBXNode        SceneRoot = lScene.GetRootNode();
            MESkeletalMesh mesh      = morph.Apply();
            FBXNode        fbxMesh   = CreateFbxMesh(mesh, morph.Name, lScene);

            SceneRoot.AddChild(fbxMesh);
            if (mesh.Bones != null)
            {
                FBXNode lSkeletonRoot = CreateFbxSkeleton(mesh.Bones, lScene);
                CreateMeshSkinning(mesh, lodIndex, fbxMesh, lSkeletonRoot, lScene);
                UpdateSkeletonWithMorph(morph, lSkeletonRoot);
                SceneRoot.AddChild(lSkeletonRoot);
                //StoreBindPose(lScene, fbxMesh);
            }
            bool lResult = FBXHelper.SaveScene(lSdkManager, lScene, targetdir);

            FBXHelper.DestroySdkObjects(lSdkManager, lResult);
        }