예제 #1
0
        public void LoadBoneAnim(FSKA.BoneAnimNode boneAnim)
        {
            objectListView1.BeginUpdate();
            objectListView1.ClearObjects();
            objectListView1.ShowGroups = false;

            FSKA fska = (FSKA)boneAnim.Parent;

            if (boneAnim.BoneAnimU != null)
            {
                stPropertyGrid1.LoadProperty(boneAnim.BoneAnimU, onPropertyChanged);
            }
            else
            {
                stPropertyGrid1.LoadProperty(boneAnim.BoneAnim, onPropertyChanged);
            }

            frameCountLbl.Text     = $" / {fska.FrameCount}";
            currentFrameUD.Maximum = fska.FrameCount;

            for (int frame = 0; frame < fska.FrameCount; frame++)
            {
                bool IsKeyed = (boneAnim.XPOS.HasAnimation() && boneAnim.XPOS.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.YPOS.HasAnimation() && boneAnim.YPOS.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.ZPOS.HasAnimation() && boneAnim.ZPOS.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.XROT.HasAnimation() && boneAnim.XROT.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.YROT.HasAnimation() && boneAnim.YROT.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.ZROT.HasAnimation() && boneAnim.ZROT.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.WROT.HasAnimation() && boneAnim.WROT.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.XSCA.HasAnimation() && boneAnim.XSCA.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.YSCA.HasAnimation() && boneAnim.YSCA.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.ZSCA.HasAnimation() && boneAnim.ZSCA.GetKeyFrame(frame).IsKeyed);

                if (IsKeyed)
                {
                    KeyFrame key = new KeyFrame();
                    key.Frame = frame;

                    //Load position
                    if (boneAnim.XPOS.HasAnimation())
                    {
                        key.PosX = boneAnim.XPOS.GetValue(frame);
                    }
                    if (boneAnim.YPOS.HasAnimation())
                    {
                        key.PosY = boneAnim.YPOS.GetValue(frame);
                    }
                    if (boneAnim.ZPOS.HasAnimation())
                    {
                        key.PosZ = boneAnim.ZPOS.GetValue(frame);
                    }

                    //Load Rotation
                    if (boneAnim.XROT.HasAnimation())
                    {
                        key.RotX = boneAnim.XROT.GetValue(frame);
                    }
                    if (boneAnim.YROT.HasAnimation())
                    {
                        key.RotY = boneAnim.YROT.GetValue(frame);
                    }
                    if (boneAnim.ZROT.HasAnimation())
                    {
                        key.RotZ = boneAnim.ZROT.GetValue(frame);
                    }
                    if (boneAnim.WROT.HasAnimation())
                    {
                        key.RotW = boneAnim.WROT.GetValue(frame);
                    }

                    //Load Scale
                    if (boneAnim.XSCA.HasAnimation())
                    {
                        key.ScaX = boneAnim.XSCA.GetValue(frame);
                    }
                    if (boneAnim.YSCA.HasAnimation())
                    {
                        key.ScaY = boneAnim.YSCA.GetValue(frame);
                    }
                    if (boneAnim.ZSCA.HasAnimation())
                    {
                        key.ScaZ = boneAnim.ZSCA.GetValue(frame);
                    }

                    objectListView1.AddObject(key);
                }
            }
            objectListView1.EndUpdate();
        }
예제 #2
0
        public void LoadBoneAnim(FSKA.BoneAnimNode boneAnim)
        {
            listViewCustom2.BeginUpdate();
            listViewCustom2.Items.Clear();

            FSKA fska = (FSKA)boneAnim.Parent;

            if (boneAnim.BoneAnimU != null)
            {
                stPropertyGrid1.LoadProperty(boneAnim.BoneAnimU, onPropertyChanged);
            }
            else
            {
                stPropertyGrid1.LoadProperty(boneAnim.BoneAnim, onPropertyChanged);
            }

            frameCountLbl.Text     = $" / {fska.FrameCount}";
            currentFrameUD.Maximum = fska.FrameCount;

            return;

            fska.SetFrame(0);
            for (int frame = 0; frame < fska.FrameCount; frame++)
            {
                bool IsKeyed = boneAnim.HasKeyedFrames(frame);
                if (IsKeyed)
                {
                    KeyFrame key = new KeyFrame();
                    key.Frame = frame;
                    keyFrames.Add(key);

                    Vector3 pos = boneAnim.GetPosition(frame);
                    var     rot = boneAnim.GetRotation(frame);
                    Vector3 sca = boneAnim.GetScale(frame);

                    key.PosX = pos.X;
                    key.PosY = pos.Y;
                    key.PosZ = pos.Z;

                    key.PosX = rot.X;
                    key.PosY = rot.Y;
                    key.PosZ = rot.Z;
                    key.RotW = rot.W;

                    key.ScaX = sca.X;
                    key.ScaY = sca.Y;
                    key.ScaZ = sca.Z;

                    listViewCustom2.Items.Add(key.Frame.ToString()).SubItems.AddRange(
                        new ListViewItem.ListViewSubItem[]
                    {
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.ScaX.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.ScaY.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.ScaZ.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.RotX.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.RotY.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.RotZ.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.RotW.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.PosX.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.PosY.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.PosZ.ToString()
                        },
                    });
                }
            }
            listViewCustom2.EndUpdate();
        }
예제 #3
0
        public void LoadBoneAnim(FSKA.BoneAnimNode boneAnim)
        {
            listViewCustom2.BeginUpdate();
            listViewCustom2.Items.Clear();


            FSKA fska = (FSKA)boneAnim.Parent;

            if (boneAnim.BoneAnimU != null)
            {
                stPropertyGrid1.LoadProperty(boneAnim.BoneAnimU, onPropertyChanged);
            }
            else
            {
                stPropertyGrid1.LoadProperty(boneAnim.BoneAnim, onPropertyChanged);
            }

            frameCountLbl.Text     = $" / {fska.FrameCount}";
            currentFrameUD.Maximum = fska.FrameCount;

            for (int frame = 0; frame < fska.FrameCount; frame++)
            {
                bool IsKeyed = (boneAnim.XPOS.HasAnimation() && boneAnim.XPOS.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.YPOS.HasAnimation() && boneAnim.YPOS.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.ZPOS.HasAnimation() && boneAnim.ZPOS.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.XROT.HasAnimation() && boneAnim.XROT.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.YROT.HasAnimation() && boneAnim.YROT.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.ZROT.HasAnimation() && boneAnim.ZROT.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.WROT.HasAnimation() && boneAnim.WROT.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.XSCA.HasAnimation() && boneAnim.XSCA.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.YSCA.HasAnimation() && boneAnim.YSCA.GetKeyFrame(frame).IsKeyed ||
                                boneAnim.ZSCA.HasAnimation() && boneAnim.ZSCA.GetKeyFrame(frame).IsKeyed);

                if (IsKeyed)
                {
                    KeyFrame key = new KeyFrame();
                    key.Frame = frame;
                    keyFrames.Add(key);

                    //Load position
                    if (boneAnim.XPOS.HasAnimation())
                    {
                        key.PosX = boneAnim.XPOS.GetValue(frame);
                    }
                    if (boneAnim.YPOS.HasAnimation())
                    {
                        key.PosY = boneAnim.YPOS.GetValue(frame);
                    }
                    if (boneAnim.ZPOS.HasAnimation())
                    {
                        key.PosZ = boneAnim.ZPOS.GetValue(frame);
                    }

                    //Load Rotation
                    if (boneAnim.XROT.HasAnimation())
                    {
                        key.RotX = boneAnim.XROT.GetValue(frame);
                    }
                    if (boneAnim.YROT.HasAnimation())
                    {
                        key.RotY = boneAnim.YROT.GetValue(frame);
                    }
                    if (boneAnim.ZROT.HasAnimation())
                    {
                        key.RotZ = boneAnim.ZROT.GetValue(frame);
                    }
                    if (boneAnim.WROT.HasAnimation())
                    {
                        key.RotW = boneAnim.WROT.GetValue(frame);
                    }

                    //Load Scale
                    if (boneAnim.XSCA.HasAnimation())
                    {
                        key.ScaX = boneAnim.XSCA.GetValue(frame);
                    }
                    if (boneAnim.YSCA.HasAnimation())
                    {
                        key.ScaY = boneAnim.YSCA.GetValue(frame);
                    }
                    if (boneAnim.ZSCA.HasAnimation())
                    {
                        key.ScaZ = boneAnim.ZSCA.GetValue(frame);
                    }

                    listViewCustom2.Items.Add(key.Frame.ToString()).SubItems.AddRange(
                        new ListViewItem.ListViewSubItem[]
                    {
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.PosX.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.PosY.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.PosZ.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.RotX.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.RotY.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.RotZ.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.RotW.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.ScaX.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.ScaY.ToString()
                        },
                        new ListViewItem.ListViewSubItem()
                        {
                            Text = key.ScaZ.ToString()
                        },
                    });
                }
            }
            listViewCustom2.EndUpdate();
        }