1
0
mirror of synced 2024-11-28 17:30:57 +01:00

Fix incorrect skeleton scaling and rotations from applying in editor

This commit is contained in:
KillzXGaming 2019-04-07 12:52:06 -04:00
parent be829619a2
commit 19852762c6
11 changed files with 16 additions and 7 deletions

Binary file not shown.

View File

@ -58,7 +58,8 @@ namespace FirstPlugin
rotModeCB.SelectedItem = bone.FlagsRotation; rotModeCB.SelectedItem = bone.FlagsRotation;
billboardModeCB.Bind(typeof(BoneFlagsBillboard), bone, "FlagsBillboard"); billboardModeCB.DataSource = Enum.GetValues(typeof(ResU.BoneFlagsBillboard));
billboardModeCB.SelectedItem = bone.FlagsBillboard;
billboardIndexUD.Value = bone.BillboardIndex; billboardIndexUD.Value = bone.BillboardIndex;
smoothIndexUD.Value = bone.SmoothMatrixIndex; smoothIndexUD.Value = bone.SmoothMatrixIndex;
@ -89,8 +90,8 @@ namespace FirstPlugin
rotModeCB.DataSource = Enum.GetValues(typeof(BoneFlagsRotation)); rotModeCB.DataSource = Enum.GetValues(typeof(BoneFlagsRotation));
rotModeCB.SelectedItem = bone.FlagsRotation; rotModeCB.SelectedItem = bone.FlagsRotation;
billboardModeCB.Bind(typeof(BoneFlagsBillboard), bone, "FlagsBillboard"); billboardModeCB.DataSource = Enum.GetValues(typeof(ResU.BoneFlagsBillboard));
billboardModeCB.SelectedItem = bone.FlagsBillboard;
billboardIndexUD.Bind(bone, "BillboardIndex"); billboardIndexUD.Bind(bone, "BillboardIndex");
smoothIndexUD.Bind(bone, "SmoothMatrixIndex"); smoothIndexUD.Bind(bone, "SmoothMatrixIndex");

View File

@ -25,6 +25,7 @@ namespace FirstPlugin.Forms
} }
public FSKL activeSkeleton; public FSKL activeSkeleton;
bool IsLoaded = false;
public void LoadSkeleton(FSKL fskl) public void LoadSkeleton(FSKL fskl)
{ {
@ -32,18 +33,22 @@ namespace FirstPlugin.Forms
if (fskl.node.SkeletonU != null) if (fskl.node.SkeletonU != null)
{ {
rotationModeCB.Bind(typeof(ResU.SkeletonFlagsRotation), fskl.node.SkeletonU, "FlagsRotation"); Console.WriteLine("FlagsScaling " + fskl.node.SkeletonU.FlagsScaling);
scalingModeCB.Bind(typeof(ResU.SkeletonFlagsScaling), fskl.node.SkeletonU, "FlagsScaling"); rotationModeCB.DataSource = Enum.GetValues(typeof(ResU.SkeletonFlagsRotation));
scalingModeCB.DataSource = Enum.GetValues(typeof(ResU.SkeletonFlagsScaling));
rotationModeCB.SelectedItem = fskl.node.SkeletonU.FlagsRotation; rotationModeCB.SelectedItem = fskl.node.SkeletonU.FlagsRotation;
scalingModeCB.SelectedItem = fskl.node.SkeletonU.FlagsScaling; scalingModeCB.SelectedItem = fskl.node.SkeletonU.FlagsScaling;
Console.WriteLine("FlagsScaling " + fskl.node.SkeletonU.FlagsScaling);
} }
else else
{ {
rotationModeCB.Bind(typeof(SkeletonFlagsRotation), fskl.node.Skeleton, "FlagsRotation"); rotationModeCB.DataSource = Enum.GetValues(typeof(SkeletonFlagsRotation));
scalingModeCB.Bind(typeof(SkeletonFlagsScaling), fskl.node.Skeleton, "FlagsScaling"); scalingModeCB.DataSource = Enum.GetValues(typeof(SkeletonFlagsScaling));
rotationModeCB.SelectedItem = fskl.node.Skeleton.FlagsRotation; rotationModeCB.SelectedItem = fskl.node.Skeleton.FlagsRotation;
scalingModeCB.SelectedItem = fskl.node.Skeleton.FlagsScaling; scalingModeCB.SelectedItem = fskl.node.Skeleton.FlagsScaling;
} }
IsLoaded = true;
} }
private void btnRgidIndices_Click(object sender, EventArgs e) private void btnRgidIndices_Click(object sender, EventArgs e)
@ -88,6 +93,9 @@ namespace FirstPlugin.Forms
private void ModeCB_SelectedIndexChanged(object sender, EventArgs e) private void ModeCB_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (!IsLoaded)
return;
if (activeSkeleton.node.SkeletonU != null) if (activeSkeleton.node.SkeletonU != null)
{ {
activeSkeleton.node.SkeletonU.FlagsRotation = (ResU.SkeletonFlagsRotation)rotationModeCB.SelectedItem; activeSkeleton.node.SkeletonU.FlagsRotation = (ResU.SkeletonFlagsRotation)rotationModeCB.SelectedItem;