fix(gltf): strip armature prefix from bone names in FurnitureGlbParser

Strip pipe-delimited armature prefixes (e.g., "MyRig|body" -> "body")
from bone names in parseSeatSkeleton and remapSeatAnimations, matching
the existing stripping already present in GlbParser. Without this,
isKnownBone checks fail when Blender exports prefixed bone names.
This commit is contained in:
NotEvil
2026-04-17 01:37:23 +02:00
parent 6dad447c05
commit d7f8bf6c72

View File

@@ -1216,6 +1216,10 @@ public final class FurnitureGlbParser {
String name = node.has("name")
? node.get("name").getAsString()
: "joint_" + j;
// Strip armature prefix (e.g., "MyRig|body" -> "body")
if (name.contains("|")) {
name = name.substring(name.lastIndexOf('|') + 1);
}
if (GltfBoneMapper.isKnownBone(name)) {
skinJointRemap[j] = filteredJointNodes.size();
filteredJointNodes.add(nodeIdx);
@@ -1257,9 +1261,13 @@ public final class FurnitureGlbParser {
int nodeIdx = filteredJointNodes.get(j);
JsonObject node = nodes.get(nodeIdx).getAsJsonObject();
jointNames[j] = node.has("name")
String rawBoneName = node.has("name")
? node.get("name").getAsString()
: "joint_" + j;
// Strip armature prefix consistently
jointNames[j] = rawBoneName.contains("|")
? rawBoneName.substring(rawBoneName.lastIndexOf('|') + 1)
: rawBoneName;
if (node.has("rotation")) {
JsonArray r = node.getAsJsonArray("rotation");
@@ -1432,6 +1440,10 @@ public final class FurnitureGlbParser {
String name = node.has("name")
? node.get("name").getAsString()
: "joint_" + j;
// Strip armature prefix (e.g., "MyRig|body" -> "body")
if (name.contains("|")) {
name = name.substring(name.lastIndexOf('|') + 1);
}
if (GltfBoneMapper.isKnownBone(name)) {
filteredJointNodes.add(nodeIdx);
}