Ejemplo n.º 1
0
        public static void Write(BinaryWriter writer, SoftwareAction softwareAction)
        {
            writer.Write(softwareAction.Name);
            writer.Write(softwareAction.FrameStart);
            writer.Write(softwareAction.FrameEnd);

            writer.Write(softwareAction.FCurves.Count);
            foreach (var curve in softwareAction.FCurves)
            {
                FCurve.Write(writer, curve);
            }
        }
Ejemplo n.º 2
0
        public Action(BinaryReader reader)
        {
            Name       = reader.ReadString();
            FrameStart = reader.ReadSingle();
            FrameEnd   = reader.ReadSingle();

            FCurves = new FCurve[reader.ReadInt32()];
            for (int i = 0; i != FCurves.Length; ++i)
            {
                FCurves[i] = new FCurve(reader);
            }

            calculatedValues = new float[FCurves.Length];
        }
Ejemplo n.º 3
0
        public Action(BinaryReader reader)
        {
            Name = reader.ReadString();
            FrameStart = reader.ReadSingle();
            FrameEnd = reader.ReadSingle();

            FCurves = new FCurve[reader.ReadInt32()];
            for (int i = 0; i != FCurves.Length; ++i)
            {
                FCurves[i] = new FCurve(reader);
            }

            calculatedValues = new float[FCurves.Length];
        }
Ejemplo n.º 4
0
        protected override void linkObjects(string dataPath, FCurve curve, int i)
        {
            bool pass = false;

            for (int bi = 0; bi != Armature.Bones.Length; ++bi)
            {
                if (dataPath == Armature.Bones[bi].Name)
                {
                    boneIndices[i] = bi;

                    if (curve.Index == 0)
                    {
                        bindActionDatas[i] = bindBoneRotationX;
                    }
                    else if (curve.Index == 1)
                    {
                        bindActionDatas[i] = bindBoneRotationY;
                    }
                    else if (curve.Index == 2)
                    {
                        bindActionDatas[i] = bindBoneRotationZ;
                    }
                    else if (curve.Index == 3)
                    {
                        bindActionDatas[i] = bindBoneRotationW;
                    }

                    pass = true;
                    break;
                }
            }
            if (!pass)
            {
                Debug.ThrowError("InstanceObjectArmature", "Failed to find Armature Bone: " + dataPath);
            }

            // link bones
            foreach (var bone in Bones)
            {
                bone.linkObjects(Bones);
            }

            // link bone childeren
            foreach (var bone in Bones)
            {
                bone.linkChilderen(Bones);
            }
        }
Ejemplo n.º 5
0
 protected virtual void linkObjects(string dataPath, FCurve curve, int i)
 {
     // place holder...
 }
        protected override void linkObjects(string dataPath, FCurve curve, int i)
        {
            bool pass = false;
            for (int bi = 0; bi != Armature.Bones.Length; ++bi)
            {
                if (dataPath == Armature.Bones[bi].Name)
                {
                    boneIndices[i] = bi;

                    if (curve.Index == 0) bindActionDatas[i] = bindBoneRotationX;
                    else if (curve.Index == 1) bindActionDatas[i] = bindBoneRotationY;
                    else if (curve.Index == 2) bindActionDatas[i] = bindBoneRotationZ;
                    else if (curve.Index == 3) bindActionDatas[i] = bindBoneRotationW;

                    pass = true;
                    break;
                }
            }
            if (!pass) Debug.ThrowError("InstanceObjectArmature", "Failed to find Armature Bone: " + dataPath);

            // link bones
            foreach (var bone in Bones)
            {
                bone.linkObjects(Bones);
            }

            // link bone childeren
            foreach (var bone in Bones)
            {
                bone.linkChilderen(Bones);
            }
        }
Ejemplo n.º 7
0
 protected virtual void linkObjects(string dataPath, FCurve curve, int i)
 {
     // place holder...
 }