mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-04 03:29:02 +08:00
fix: test failures in Merge Armature (#1487)
... apparently auto-merge wasn't set properly to check for unit test completion. oops.
This commit is contained in:
parent
295a46ec12
commit
ec73eb6225
@ -484,31 +484,31 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
var targetObjectName = childName.Substring(config.prefix.Length,
|
||||
childName.Length - config.prefix.Length - config.suffix.Length);
|
||||
var targetObject = newParent.transform.Find(targetObjectName);
|
||||
|
||||
if (childPhysBonesBlockedSet != null
|
||||
&& !childPhysBonesBlockedSet.Contains(child)
|
||||
&& !child.TryGetComponent<ModularAvatarPBBlocker>(out _))
|
||||
{
|
||||
// This object is potentially impacted by the parent's physbones; is it humanoid?
|
||||
if (!reportedHumanoidBoneError && targetObject != null &&
|
||||
humanoidBones.Contains(targetObject.transform))
|
||||
{
|
||||
// If so, fail the build, as we won't properly apply this to humanoid children.
|
||||
BuildReport.LogFatal(
|
||||
"error.merge_armature.physbone_on_humanoid_bone", new string[0], config);
|
||||
reportedHumanoidBoneError = true;
|
||||
}
|
||||
|
||||
// Don't move this child object
|
||||
continue;
|
||||
}
|
||||
|
||||
// Zip merge bones if the names match and the outfit side is not affected by its own PhysBone.
|
||||
// Also zip merge when it seems to have been copied from avatar side by checking the dinstance.
|
||||
if (targetObject != null)
|
||||
{
|
||||
if (childPhysBonesBlockedSet != null
|
||||
&& !childPhysBonesBlockedSet.Contains(child)
|
||||
&& !child.TryGetComponent<ModularAvatarPBBlocker>(out _))
|
||||
{
|
||||
// This object is potentially impacted by the parent's physbones; is it humanoid?
|
||||
if (!reportedHumanoidBoneError && humanoidBones.Contains(targetObject.transform))
|
||||
{
|
||||
// If so, fail the build, as we won't properly apply this to humanoid children.
|
||||
BuildReport.LogFatal(
|
||||
"error.merge_armature.physbone_on_humanoid_bone", new string[0], config);
|
||||
reportedHumanoidBoneError = true;
|
||||
}
|
||||
|
||||
// Don't move this child object
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
childNewParent = targetObject.gameObject;
|
||||
shouldZip = true;
|
||||
}
|
||||
childNewParent = targetObject.gameObject;
|
||||
shouldZip = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,11 +43,13 @@ public class MergeArmatureTests : TestBase
|
||||
|
||||
var targetHips = root.transform.Find("Armature");
|
||||
|
||||
Assert.AreEqual(2, targetHips.childCount);
|
||||
Assert.AreEqual(1, targetHips.childCount);
|
||||
Assert.AreEqual("L_1", targetHips.GetChild(0).gameObject.name);
|
||||
Assert.That(targetHips.GetChild(1).gameObject.name, Does.StartWith("L_1$"));
|
||||
var l1 = targetHips.GetChild(0).transform;
|
||||
var l1x = l1.GetChild(l1.childCount - 1).transform;
|
||||
Assert.That(l1x.gameObject.name, Does.StartWith("L_1$"));
|
||||
|
||||
Assert.That(targetHips.GetChild(1), Is.EqualTo(physBoneTarget));
|
||||
Assert.That(l1x, Is.EqualTo(physBoneTarget));
|
||||
Assert.That(physBone.ignoreTransforms, Is.Empty);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user