Fix: glTF: Fix regression - bone flat hierarchy export

This commit is contained in:
Julien Duroure
2025-05-02 15:53:53 +02:00
parent 743a6ae2a5
commit 61e6c91c4e
3 changed files with 7 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (4, 5, 27),
"version": (4, 5, 28),
'blender': (4, 4, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@@ -80,10 +80,12 @@ def __gather_scene(blender_scene, export_settings):
# Now, we can filter tree if needed
vtree.filter()
vtree.bake_armature_bone_list() # Used in case we remove the armature. Doing it after filter, as filter can remove some bones
if export_settings['gltf_flatten_bones_hierarchy'] is True:
vtree.break_bone_hierarchy()
vtree.bake_armature_bone_list() # Used in case we remove the armature. Doing it after filter, as filter can remove some bones
# And ater breaking bone hierarchy, as this changed the root list
if export_settings['gltf_flatten_obj_hierarchy'] is True:
vtree.break_obj_hierarchy()

View File

@@ -922,6 +922,8 @@ class VExportTree:
self.nodes[self.nodes[bone].parent_uuid].children.remove(bone)
self.nodes[bone].parent_uuid = arma
self.nodes[arma].children.append(bone)
self.nodes[arma].children_type[bone] = VExportNode.CHILDREN_REAL
self.nodes[bone].parent_bone_uuid = None
def break_obj_hierarchy(self):
# Can be usefull when matrix is not decomposable