BFRES : Display scaling rule for non animated skeletons.

This commit is contained in:
KillzXGaming 2021-04-17 19:21:42 -04:00
parent ec79648626
commit 7331a268bf
4 changed files with 17 additions and 1 deletions

View file

@ -49,7 +49,7 @@ namespace Bfres.Structs
{
if (bn.Text == Bone.Name)
{
if (bn.UseSmoothMatrix || bn.SmoothMatrixIndex > 0)
if (bn.UseSmoothMatrix || bn.SmoothMatrixIndex > -1)
{
bn.SmoothMatrixIndex = (short)SmoothIndex++;

View file

@ -544,6 +544,9 @@ namespace FirstPlugin
BfresBone STBone = new BfresBone(RenderableSkeleton);
ReadBone(STBone, bone);
RenderableSkeleton.bones.Add(STBone);
if (skeleton.FlagsScaling == SkeletonFlagsScaling.Maya)
STBone.UseSegmentScaleCompensate = true;
}
skl.Nodes.Clear();

View file

@ -357,6 +357,9 @@ namespace FirstPlugin
BfresBone STBone = new BfresBone(RenderableSkeleton);
ReadBone(STBone, bone);
RenderableSkeleton.bones.Add(STBone);
if (skeleton.FlagsScaling == SkeletonFlagsScaling.Maya)
STBone.UseSegmentScaleCompensate = true;
}
skl.Nodes.Clear();

View file

@ -11,6 +11,7 @@ using Bfres.Structs;
using ResU = Syroot.NintenTools.Bfres;
using Syroot.NintenTools.NSW.Bfres;
using Toolbox.Library.Forms;
using Toolbox.Library;
namespace FirstPlugin.Forms
{
@ -112,12 +113,21 @@ namespace FirstPlugin.Forms
{
activeSkeleton.node.SkeletonU.FlagsRotation = (ResU.SkeletonFlagsRotation)rotationModeCB.SelectedItem;
activeSkeleton.node.SkeletonU.FlagsScaling = (ResU.SkeletonFlagsScaling)scalingModeCB.SelectedItem;
foreach (var bone in activeSkeleton.bones)
bone.UseSegmentScaleCompensate = activeSkeleton.node.SkeletonU.FlagsScaling.HasFlag(SkeletonFlagsScaling.Maya);
activeSkeleton.update();
}
else
{
activeSkeleton.node.Skeleton.FlagsRotation = (SkeletonFlagsRotation)rotationModeCB.SelectedItem;
activeSkeleton.node.Skeleton.FlagsScaling = (SkeletonFlagsScaling)scalingModeCB.SelectedItem;
foreach (var bone in activeSkeleton.bones)
bone.UseSegmentScaleCompensate = activeSkeleton.node.Skeleton.FlagsScaling.HasFlag(SkeletonFlagsScaling.Maya);
activeSkeleton.update();
}
LibraryGUI.UpdateViewport();
}
}
}