Exemplo n.º 1
0
        public IOAnimation GetIOAnimation()
        {
            IOAnimation anim = new IOAnimation
            {
                Name         = Text,
                FrameCount   = animation.FrameCount,
                RotationType = IORotationType.Quaternion
            };

            SsbhAnimTrackDecoder decoder = new SsbhAnimTrackDecoder(animation);

            foreach (AnimGroup animGroup in animation.Animations)
            {
                // Bone Animations
                if (animGroup.Type == AnimType.Transform)
                {
                    foreach (AnimNode animNode in animGroup.Nodes)
                    {
                        foreach (AnimTrack track in animNode.Tracks)
                        {
                            if (track.Name.Equals("Transform"))
                            {
                                object[] transform = decoder.ReadTrack(track);
                                for (int i = 0; i < transform.Length; i++)
                                {
                                    AnimTrackTransform t = (AnimTrackTransform)transform[i];
                                    anim.AddKey(animNode.Name, IOTrackType.POSX, i, t.X);
                                    anim.AddKey(animNode.Name, IOTrackType.POSY, i, t.Y);
                                    anim.AddKey(animNode.Name, IOTrackType.POSZ, i, t.Z);
                                    anim.AddKey(animNode.Name, IOTrackType.ROTX, i, t.Rx);
                                    anim.AddKey(animNode.Name, IOTrackType.ROTY, i, t.Ry);
                                    anim.AddKey(animNode.Name, IOTrackType.ROTZ, i, t.Rz);
                                    anim.AddKey(animNode.Name, IOTrackType.ROTW, i, t.Rw);
                                    anim.AddKey(animNode.Name, IOTrackType.SCAX, i, t.Sx);
                                    anim.AddKey(animNode.Name, IOTrackType.SCAY, i, t.Sy);
                                    anim.AddKey(animNode.Name, IOTrackType.SCAZ, i, t.Sz);
                                }
                            }
                        }
                    }
                }
            }

            return(anim);
        }
Exemplo n.º 2
0
        public IOAnimation GetIOAnimation()
        {
            IOAnimation Anim = new IOAnimation();

            Anim.Name         = Text;
            Anim.FrameCount   = animation.FrameCount;
            Anim.RotationType = IORotationType.Quaternion;

            SSBHAnimTrackDecoder decoder = new SSBHAnimTrackDecoder(animation);

            foreach (AnimGroup animGroup in animation.Animations)
            {
                // Bone Animations
                if (animGroup.Type == ANIM_TYPE.Transform)
                {
                    foreach (AnimNode animNode in animGroup.Nodes)
                    {
                        foreach (AnimTrack track in animNode.Tracks)
                        {
                            if (track.Name.Equals("Transform"))
                            {
                                object[] Transform = decoder.ReadTrack(track);
                                for (int i = 0; i < Transform.Length; i++)
                                {
                                    AnimTrackTransform t = (AnimTrackTransform)Transform[i];
                                    Anim.AddKey(animNode.Name, IOTrackType.POSX, i, t.X);
                                    Anim.AddKey(animNode.Name, IOTrackType.POSY, i, t.Y);
                                    Anim.AddKey(animNode.Name, IOTrackType.POSZ, i, t.Z);
                                    Anim.AddKey(animNode.Name, IOTrackType.ROTX, i, t.RX);
                                    Anim.AddKey(animNode.Name, IOTrackType.ROTY, i, t.RY);
                                    Anim.AddKey(animNode.Name, IOTrackType.ROTZ, i, t.RZ);
                                    Anim.AddKey(animNode.Name, IOTrackType.ROTW, i, t.RW);
                                    Anim.AddKey(animNode.Name, IOTrackType.SCAX, i, t.SX);
                                    Anim.AddKey(animNode.Name, IOTrackType.SCAY, i, t.SY);
                                    Anim.AddKey(animNode.Name, IOTrackType.SCAZ, i, t.SZ);
                                }
                            }
                        }
                    }
                }
            }

            return(Anim);
        }