Skip to content

Commit 0e9be1c

Browse files
committed
Fix export exceptions when reparenting ragdoll bones
1 parent 0a78df5 commit 0e9be1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addons/KHR_physics_rigid_bodies/blender/exp/gltf2_blender_rigid_bodies.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ def _buildParentMap(
219219
node: gltf2_io.Node,
220220
):
221221
nodeToParent[node] = parent
222+
if node == None or node.children == None:
223+
return
222224
for c in node.children:
223225
self._buildParentMap(nodeToParent, node, c)
224226

@@ -241,7 +243,7 @@ def gather_joint_hook(
241243

242244
self.gltfNodeToBlender[gltf2_node] = blender_bone
243245
constraint = self._getBoneChildConstraint(blender_bone)
244-
if constraint != None:
246+
if constraint != None and constraint.target != None:
245247
target = constraint.target
246248
if target.rigid_body or self._getParentCompoundBody(target) != None:
247249
self.blenderBoneToGltfNode[blender_bone] = gltf2_node

0 commit comments

Comments
 (0)