Better error reporting when there are multiple root bones

This commit is contained in:
Colin Basnett
2026-03-02 19:59:06 -08:00
parent ee05baf508
commit 6c917faad1

View File

@@ -350,9 +350,12 @@ def create_psx_bones(
armature_tree = ObjectTree(armature_objects) armature_tree = ObjectTree(armature_objects)
if len(armature_tree.root_nodes) >= 2: if len(armature_tree.root_nodes) >= 2:
root_bone_names = []
for root_node in armature_tree.root_nodes:
root_bone_names.append(root_node.object.name)
raise RuntimeError( raise RuntimeError(
'Multiple root armature objects were found. ' f'Multiple root armature objects were found: {root_bone_names}.\n'
'Only one root armature object is allowed. ' 'Only one root armature object is allowed.\n'
'To use multiple armature objects, parent them to one another in a hierarchy using Bone parenting.' 'To use multiple armature objects, parent them to one another in a hierarchy using Bone parenting.'
) )