saturday06 / VRM-Addon-for-Blender

VRM Importer, Exporter and Utilities for Blender 2.93 to 4.2
https://vrm-addon-for-blender.info
MIT License
1.33k stars 142 forks source link

Bug report: Error blocks export! #593

Open tdw46 opened 1 month ago

tdw46 commented 1 month ago

Describe the bug

Exporting the model in this file throws the below error:

Python: Traceback (most recent call last):
  File "C:\Users\tyler\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\vrm\exporter\vrm1_exporter.py", line 2234, in export_vrm
    export_scene_gltf_result = export_scene_gltf(
                               ^^^^^^^^^^^^^^^^^^
  File "C:\Users\tyler\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\vrm\external\io_scene_gltf2_support.py", line 290, in export_scene_gltf
    return __invoke_export_scene_gltf(arguments)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tyler\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\vrm\external\io_scene_gltf2_support.py", line 261, in __invoke_export_scene_gltf
    return bpy.ops.export_scene.gltf(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\modules\bpy\ops.py", line 109, in __call__
    ret = _op_call(self.idname_py(), kw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error: Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\addons_core\io_scene_gltf2\__init__.py", line 1289, in execute
    res = gltf2_blender_export.save(context, export_settings)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.2\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\Blender Foundation\Blender 4.2\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\Blender Foundation\Blender 4.2\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\Blender Foundation\Blender 4.2\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\Blender Foundation\Blender 4.2\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\Blender Foundation\Blender 4.2\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 94, in __gather_scene
    node = gltf2_blender_gather_nodes.gather_node(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 48, in gather_node
    children=__gather_children(vnode, export_settings),
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 130, in __gather_children
    joint = gltf2_blender_gather_joints.gather_joint_vnode(bone_uuid, export_settings)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.2\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\Blender Foundation\Blender 4.2\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_joints.py", line 52, in gather_joint_vnode
    blender_bone = vtree.nodes[vnode].blender_bone
                   ~~~~~~~~~~~^^^^^^^
KeyError: '7c086f4d-701a-4d5a-ac03-be48d06bc98f'
Location: C:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\modules\bpy\ops.py:109
bpy.ops.export_scene.vrm(filepath="K:\\.shortcut-targets-by-id\\1aRXREtY-fSWoeNl1VQsH9wxH57ETCnO2\\3D\\Avatars\\.Hallway\\00012_M_GI-Joe\\GI Joe_v01-1b.vrm", use_addon_preferences=True, export_invisibles=False, export_only_selections=True, enable_advanced_preferences=False, export_all_influences=False, export_lights=False, errors=[{"name":"VrmModelError1", "message":"Non-tri faces detected in \"BézierCurve.009\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError2", "message":"Non-tri faces detected in \"Hair Top strands\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError3", "message":"Non-tri faces detected in \"Hair Front\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError4", "message":"Non-tri faces detected in \"BézierCurve.002\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError5", "message":"Non-tri faces detected in \"BézierCurve.003\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError6", "message":"Non-tri faces detected in \"BézierCurve.004\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError7", "message":"Non-tri faces detected in \"Hair sides\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError8", "message":"Non-tri faces detected in \"BézierCurve.005\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError9", "message":"Non-tri faces detected in \"BézierCurve.006\". will be triangulated automatically.", "severity":3}, {"name":"VrmModelError10", "message":"Non-tri faces detected in \"BézierCurve.007\". will be triangulated automatically.", "severity":3}])

To Reproduce

Steps to reproduce the behavior:

  1. Try to export as VRM
  2. Error will be thrown and VRM export will be cancelled
  3. See error

Desktop (please complete the following information)

Additional context

I don't think this issue was happening for me with the same addon version and blender 4.2 before... However, it also affects other people I work with in latest blender and latest addon version. Uninstalling blender and reinstalling doesn't fix. It looks like the io-scene gltf 2 addon is experiencing issues. But I don't think that should have changed in b4.2.2 ...

saturday06 commented 1 month ago

Thank you for your report!

This is a bug in the glTF 2.0 add-on that occurred when “Remove Armature Object” was enabled. I reproduced the file you uploaded. Could you please report this bug to the glTF 2.0 add-on?

https://github.com/KhronosGroup/glTF-Blender-IO/issues

スクリーンショット 2024-10-16 075623 スクリーンショット 2024-10-16 075657

To avoid the bug, the option will be disabled in the next release.

saturday06 commented 2 weeks ago

https://github.com/KhronosGroup/glTF-Blender-IO/issues/2394

saturday06 commented 6 days ago

The bug has been fixed in the latest version 2.28.0 just released. Please try it.