예제 #1
0
        private bool loadMORP(BinaryReader reader, odfFileSection fileSec)
        {
            ObjectName      name            = new ObjectName(reader.ReadBytes(64));
            ObjectID        id              = new ObjectID(reader.ReadBytes(4));
            int             numMorphObjects = reader.ReadInt32();
            odfMorphSection morpSection     = new odfMorphSection(id, numMorphObjects);

            morpSection.Name = name;
            for (int morphObjIdx = 0; morphObjIdx < numMorphObjects; morphObjIdx++)
            {
                id = new ObjectID(reader.ReadBytes(4));
                byte[]         alwaysZero       = reader.ReadBytes(16);
                int            numSelectorInfos = reader.ReadInt32();
                int            numProfiles      = reader.ReadInt32();
                odfMorphObject morphObj         = new odfMorphObject(id, numSelectorInfos, numProfiles);
                morphObj.AlwaysZero16 = alwaysZero;
                morphObj.Name         = new ObjectName(reader.ReadBytes(64));

                morphObj.NumIndices     = reader.ReadInt32();
                morphObj.MeshIndices    = reader.ReadUInt16Array(morphObj.NumIndices);
                morphObj.UnknownIndices = reader.ReadInt32Array(morphObj.NumIndices);

                for (int idx = 0; idx < numProfiles; idx++)
                {
                    odfMorphProfile profile = new odfMorphProfile();
                    profile.VertexList = ParseVertexList(reader, morphObj.NumIndices);
                    profile.Name       = new ObjectName(reader.ReadBytes(64));

                    morphObj.AddChild(profile);
                }

                List <odfMorphSelector> selectorList = new List <odfMorphSelector>(numSelectorInfos);
                for (int idx = 0; idx < numSelectorInfos; idx++)
                {
                    odfMorphSelector selectorInfo = new odfMorphSelector();
                    selectorInfo.Threshold    = reader.ReadInt32();
                    selectorInfo.ProfileIndex = reader.ReadInt32();

                    selectorList.Add(selectorInfo);
                }
                morphObj.SelectorList = selectorList;

                morphObj.ClipType = reader.ReadInt32();
                if (morphObj.ClipType > 0)
                {
                    int numClipInfos             = reader.ReadInt32();
                    List <odfMorphClip> clipList = new List <odfMorphClip>(numClipInfos);
                    for (int idx = 0; idx < numClipInfos; idx++)
                    {
                        odfMorphClip clipInfo = new odfMorphClip();
                        clipInfo.StartIndex = reader.ReadInt32();
                        clipInfo.EndIndex   = reader.ReadInt32();
                        clipInfo.Unknown    = reader.ReadInt32();

                        clipList.Add(clipInfo);
                    }
                    morphObj.MorphClipList = clipList;
                }

                morphObj.MinusOne = reader.ReadInt32();
                morphObj.FrameId  = new ObjectID(reader.ReadBytes(4));

                morpSection.AddChild(morphObj);
            }

            fileSec.Section = morpSection;
            MorphSection    = morpSection;
            return(true);
        }
예제 #2
0
파일: Fbx.cs 프로젝트: kkdevs/sb3u
        public static void ExportMorphFbx([DefaultVar] odfParser parser, string path, odfMesh mesh, odfMorphClip morphClip, string exportFormat)
        {
//			Fbx.Exporter.ExportMorph(path, xxparser, meshFrame, morphClip, xaparser, exportFormat);
        }