You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to export with "Remove Armature Object" enabled causes "AttributeError: 'NoneType' object has no attribute 'children'" under certain conditions
#2436
Open
saturday06 opened this issue
Dec 10, 2024
· 2 comments
Trying to export the armature and mesh as a GLB file while "Remove Armature Object" is enabled will result in an "AttributeError: 'NoneType' object has no attribute 'children'" and the export will fail under certain conditions.
22:14:22 | INFO: Starting glTF 2.0 export
22:14:22 | INFO: Extracting primitive: Triangle
22:14:22 | INFO: Primitives created: 1
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender4.2LTS_4.2.4.0_x64__ppwjx1n5r4v9t\Blender\4.2\scripts\addons_core\io_scene_gltf2\__init__.py", line 1313, in execute
res = gltf2_blender_export.save(context, export_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender4.2LTS_4.2.4.0_x64__ppwjx1n5r4v9t\Blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 37, in save
json, buffer = __export(export_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender4.2LTS_4.2.4.0_x64__ppwjx1n5r4v9t\Blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 55, in __export
__gather_gltf(exporter, export_settings)
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender4.2LTS_4.2.4.0_x64__ppwjx1n5r4v9t\Blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 202, in __gather_gltf
active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender4.2LTS_4.2.4.0_x64__ppwjx1n5r4v9t\Blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 31, in gather_gltf2
scenes.append(__gather_scene(blender_scene, export_settings))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender4.2LTS_4.2.4.0_x64__ppwjx1n5r4v9t\Blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 37, in wrapper_cached
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender4.2LTS_4.2.4.0_x64__ppwjx1n5r4v9t\Blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 123, in __gather_scene
vtree.add_neutral_bones()
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender4.2LTS_4.2.4.0_x64__ppwjx1n5r4v9t\Blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_tree.py", line 822, in add_neutral_bones
self.nodes[n.armature].node.children.append(neutral_bone)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'children'
To Reproduce
Open the attached remove-armature-object-debug-20241210.blend
Go to the glTF exporter (File > Export > glTF 2.0 (.glb/.gltf))
Hello,
Confirmed.
This happen only when some vertices are not assigned to any bones (so glTF exporter create a neutral joint to assign these vertices to it)
We check if we can remove the armature object at start of the process, without knowing yet if a neutral bone is required
The addition of the neutral bone is calculated during the mesh/skin extraction
If the armature is at root of the scene, we cannot add the neutral bone, as we must have in glTF a unique root joint (see error SKIN_NO_COMMON_ROOT in validator). So ... If we remove the armature and add a neutral bone, the glTF file is not valid
Describe the bug
Trying to export the armature and mesh as a GLB file while "Remove Armature Object" is enabled will result in an "AttributeError: 'NoneType' object has no attribute 'children'" and the export will fail under certain conditions.
To Reproduce
Expected behavior
The export should not fail.
Screenshots
remove-armature-object-debug-20241210.mp4
.blend file/ .gltf (mandatory)
remove-armature-object-debug-20241210.zip
Version
Additional context
Original bug report is saturday06/VRM-Addon-for-Blender#675
The text was updated successfully, but these errors were encountered: