mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
parent
cdb5ede7fe
commit
3bed8b8527
@ -22,4 +22,22 @@ public class GameObjectGC : TestBase
|
||||
Assert.NotNull(animator.GetBoneTransform(HumanBodyBones.Chest));
|
||||
Assert.True(fake_humanoid.transform.Find("Body") == null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RetainEndBones()
|
||||
{
|
||||
var fake_humanoid = CreatePrefab("FakeHumanoid.prefab");
|
||||
var avdesc = fake_humanoid.GetComponent<VRCAvatarDescriptor>();
|
||||
|
||||
var bone1 = CreateChild(fake_humanoid, "bone1");
|
||||
var bone2 = CreateChild(bone1, "bone2.end");
|
||||
var bone3 = CreateChild(fake_humanoid, "bone2");
|
||||
|
||||
new GCGameObjectsPass(new BuildContext(avdesc), fake_humanoid).OnPreprocessAvatar();
|
||||
AvatarProcessor.ProcessAvatar(fake_humanoid);
|
||||
|
||||
Assert.True(bone1 != null);
|
||||
Assert.True(bone2 != null);
|
||||
Assert.True(bone3 == null);
|
||||
}
|
||||
}
|
@ -89,6 +89,16 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/bdunderscore/modular-avatar/issues/332
|
||||
// Retain transforms with names ending in "end" as these might be used for VRM spring bones
|
||||
foreach (Transform t in _root.GetComponentsInChildren<Transform>())
|
||||
{
|
||||
if (t.name.ToLower().EndsWith("end"))
|
||||
{
|
||||
MarkObject(t.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void MarkPhysBone(VRCPhysBone pb)
|
||||
@ -186,4 +196,4 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user