コード例 #1
0
 public void AnimationSave(string filename, VBone[] BindBones)
 {
     if (keys.Count > 0 && BindBones.Length > 0)
     {
         KFile.SavePSA(filename, AnimationName, BindBones, keys.ToArray());
     }
 }
コード例 #2
0
 private void EVENT_ButtonSetMaterial(object sender, EventArgs e)
 {
     if (model != null)
     {
         OpenFileDialog openFile = new OpenFileDialog();
         openFile.Filter = "Texture File|*.png";
         openFile.Title  = "Select a Texture File";
         if (openFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             Texture2D texture = KFile.LoadTexture(RenderingPanel.Renderer.device, openFile.FileName);
             if (texture != null)
             {
                 model.SetMaterial(texture);
             }
         }
     }
 }
コード例 #3
0
        // Ładowanie/Zapisywanie animacji
        public void AnimationLoad(string filename)
        {
            ClearAllFrames();
            KAnimInfo info = KFile.LoadPSA(filename);

            AnimationName = info.Name;
            keys          = info.Frames;
            if (keys.Count > 0)
            {
                AnimationTotalTime = (keys.Count - 1) * StepTime;
                ActualFrame        = keys[0];
                if (FrameAmountChanged != null)
                {
                    FrameAmountChanged(this, EventArgs.Empty);
                }
                IsAnimationLoaded = true;
            }
        }
コード例 #4
0
        private void EVENT_ButtonLoadPSK(object sender, EventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "PSK File|*.psk";
            openFile.Title  = "Select a Skeletal Mesh File";
            if (openFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                model = KFile.LoadPSK(RenderingPanel.Renderer.device, openFile.FileName);
                RenderingPanel.SetMesh(model);
                if (model != null)
                {
                    BonePanel.SetData(model.GetBones());
                    menu_animload.Enabled      = true;
                    menu_animsave.Enabled      = true;
                    menu_modelmaterial.Enabled = true;
                    AnimPanel.Enabled          = true;
                }
            }
        }