Skip to content

Commit 5052781

Browse files
committed
fix: Prevent creation of duplicate bone children
Checks for suffixes "_end" and "_Tail" in the name of a bone, then doesn't create child bone if there already is one of the aforementioned suffixes. It also looks for an "_end" tail because Blender armatures might import into Roblox with a bone child already created with an "_end" suffix (if it was exported with that setting enabled) https://blender.stackexchange.com/questions/109972/fbx-export-bone-end
1 parent b4ba1ee commit 5052781

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src-build/init.luau

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ function Class:m_CreateBoneTree(RootPart: BasePart, RootBone: Bone)
152152
HasBoneChild = true
153153
end
154154
end
155-
155+
156+
if string.sub(Bone.Name,#Bone.Name-3,#Bone.Name) == "_end"
157+
or string.sub(Bone.Name,#Bone.Name-4,#Bone.Name) == "_Tail"
158+
then
159+
HasBoneChild = true
160+
end
161+
156162
if not HasBoneChild then -- Add tail bone for transform calculations
157163
SB_VERBOSE_LOG(`Adding tail bone`)
158164
local Parent = Bone.Parent

src/init.luau

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ function Class:m_CreateBoneTree(RootPart: BasePart, RootBone: Bone)
152152
HasBoneChild = true
153153
end
154154
end
155-
155+
156+
if string.sub(Bone.Name,#Bone.Name-3,#Bone.Name) == "_end"
157+
or string.sub(Bone.Name,#Bone.Name-4,#Bone.Name) == "_Tail"
158+
then
159+
HasBoneChild = true
160+
end
161+
156162
if not HasBoneChild then -- Add tail bone for transform calculations
157163
SB_VERBOSE_LOG(`Adding tail bone`)
158164
local Parent = Bone.Parent

0 commit comments

Comments
 (0)