From 7da61d36c17373e46205a549dcc3e4eac4e0f3c6 Mon Sep 17 00:00:00 2001 From: dexy Date: Thu, 21 Nov 2019 19:05:31 +1100 Subject: [PATCH] Added root motion option to ModelForm --- Forms/ModelForm.Designer.cs | 1 + Forms/ModelForm.cs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/Forms/ModelForm.Designer.cs b/Forms/ModelForm.Designer.cs index 3cd8c4b..80b9921 100644 --- a/Forms/ModelForm.Designer.cs +++ b/Forms/ModelForm.Designer.cs @@ -722,6 +722,7 @@ this.EnableRootMotionCheckBox.TabIndex = 37; this.EnableRootMotionCheckBox.Text = "Enable root motion"; this.EnableRootMotionCheckBox.UseVisualStyleBackColor = true; + this.EnableRootMotionCheckBox.CheckedChanged += new System.EventHandler(this.EnableRootMotionCheckBox_CheckedChanged); // // label22 // diff --git a/Forms/ModelForm.cs b/Forms/ModelForm.cs index 1f19f17..9cd6a95 100644 --- a/Forms/ModelForm.cs +++ b/Forms/ModelForm.cs @@ -113,6 +113,7 @@ namespace CodeWalker.Forms MetaHash ModelHash; Archetype ModelArchetype = null; + bool EnableRootMotion = false; @@ -520,6 +521,11 @@ namespace CodeWalker.Forms private void RenderSingleItem() { + if (AnimClip != null) + { + AnimClip.EnableRootMotion = EnableRootMotion; + } + if (Ydr != null) { @@ -1985,5 +1991,10 @@ namespace CodeWalker.Forms { SelectClip(ClipComboBox.Text); } + + private void EnableRootMotionCheckBox_CheckedChanged(object sender, EventArgs e) + { + EnableRootMotion = EnableRootMotionCheckBox.Checked; + } } }