KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.49k stars 317 forks source link

Stress test with official Blender Demo files #1435

Closed atteneder closed 3 years ago

atteneder commented 3 years ago

Describe the bug

The Blender Foundation hosts a couple of official demo files on their website. It would be great if all/most/some of those could be exported as expected without errors.

Those files are quite sophisticated, so it would be a good stress test. I'm also aware that not all features/aspects of a model can be exported (e.g. materials not using the principled BRDF shader).

To Reproduce

I'm gonna give steps for one particular file, the "Hi, my name is Amy" file:

  1. Go to this web page and click the "Download" button to load the 220 MB file
  2. Open said file with Blender
  3. Try to export a glTF file (I tried both the entire scene or just the head mesh)
  4. See error
Python: Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/__init__.py", line 626, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 46, in save
    json, buffer = __export(export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 63, in __export
    __gather_gltf(exporter, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 75, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 39, in gather_gltf2
    animations += __gather_animations(blender_scene, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 83, in __gather_animations
    animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(_blender_object, merged_tracks, len(animations), export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 76, in gather_animations
    animation = __gather_animation(blender_action, blender_object, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 114, in __gather_animation
    channels=__gather_channels(blender_action, blender_object, export_settings),
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 149, in __gather_channels
    return gltf2_blender_gather_animation_channels.gather_animation_channels(
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 74, in gather_animation_channels
    channel = __gather_animation_channel(
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 202, in __gather_animation_channel
    sampler=__gather_sampler(channels, blender_object, export_settings, bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj),
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 254, in __gather_sampler
    return gltf2_blender_gather_animation_samplers.gather_animation_sampler(
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py", line 67, in gather_animation_sampler
    input=__gather_input(channels, blender_object_if_armature, non_keyed_values,
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py", line 235, in __gather_input
    keyframes = gltf2_blender_gather_animation_sampler_keyframes.gather_keyframes(blender_object_if_armature,
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py", line 231, in gather_keyframes
    mat = get_bone_matrix(
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 90, in wrapper_bonecache
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py", line 177, in get_bone_matrix
    drivers_to_manage = get_sk_drivers(obj_driver)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 117, in wrapper_skdriverdiscover
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py", line 55, in get_sk_drivers
    idx = shapekeys_idx[sk_name]
KeyError: 'XZ_Wrist_Up.L'

Expected behavior A valid glTF file that can be loaded by reference viewers

Screenshots

image

Version

Thanks!

julienduroure commented 3 years ago

Can you please test with blender 3.0 alpha / master ? This is probably #1415 , so already fixed.

atteneder commented 3 years ago

Sure!

version: 3.0.0 Alpha, branch: master, commit date: 2021-07-16 19:29, hash: 118803893e65, type: Release build date: 2021-07-16, 20:02:04 io_scene_gltf2 (version: (1, 7, 17)

Similar result:

20:15:40 | INFO: Starting glTF 2.0 export
20:15:41 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
20:15:41 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
20:15:41 | WARNING: Animation target pose.bones["FK-Hand not found
20:15:41 | WARNING: Animation target pose.bones["GRP-Lip_Top not found
20:15:41 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
20:15:41 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
20:15:41 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
20:15:41 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
20:15:41 | WARNING: Animation target pose.bones["FK-Hand not found
20:15:41 | WARNING: Animation target pose.bones["IK-Hand not found
Python: Traceback (most recent call last):
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/__init__.py", line 637, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 46, in save
    json, buffer = __export(export_settings)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 63, in __export
    __gather_gltf(exporter, export_settings)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 77, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 39, in gather_gltf2
    animations += __gather_animations(blender_scene, export_settings)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 83, in __gather_animations
    animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(_blender_object, merged_tracks, len(animations), export_settings)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 76, in gather_animations
    animation = __gather_animation(blender_action, blender_object, export_settings)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 114, in __gather_animation
    channels=__gather_channels(blender_action, blender_object, export_settings),
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 149, in __gather_channels
    return gltf2_blender_gather_animation_channels.gather_animation_channels(
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 74, in gather_animation_channels
    channel = __gather_animation_channel(
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 202, in __gather_animation_channel
    sampler=__gather_sampler(channels, blender_object, export_settings, bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj),
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 254, in __gather_sampler
    return gltf2_blender_gather_animation_samplers.gather_animation_sampler(
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py", line 67, in gather_animation_sampler
    input=__gather_input(channels, blender_object_if_armature, non_keyed_values,
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py", line 235, in __gather_input
    keyframes = gltf2_blender_gather_animation_sampler_keyframes.gather_keyframes(blender_object_if_armature,
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py", line 231, in gather_keyframes
    mat = get_bone_matrix(
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 90, in wrapper_bonecache
    result = func(*args)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py", line 177, in get_bone_matrix
    drivers_to_manage = get_sk_drivers(obj_driver)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 117, in wrapper_skdriverdiscover
    result = func(*args)
  File "/Users/aa/sdk/blender-git/build_darwin/bin/Blender.app/Contents/Resources/3.0/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py", line 59, in get_sk_drivers
    idx = shapekeys_idx[sk_name]
KeyError: 'XZ_Wrist_Up.L'

hth

julienduroure commented 3 years ago

Ok... This is summer break, I am AFK for the next 3 weeks, but I will have a look after

atteneder commented 3 years ago

No need to hurry. Enjoy your time off!

julienduroure commented 3 years ago

Problem identified. Linked to muted drivers on shapekeys. Here is a minimalist file to reproduce the issue driver_muted.blend.zip

atteneder commented 3 years ago

Thanks for the fix.

When I tested exporting said file again I seem to be running into the next problem:

19:03:06 | INFO: Starting glTF 2.0 export
19:03:07 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
19:03:07 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Hand not found
19:03:07 | WARNING: Animation target pose.bones["GRP-Lip_Top not found
19:03:07 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Hand not found
19:03:07 | WARNING: Animation target pose.bones["IK-Hand not found
19:03:07 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
19:03:07 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Hand not found
19:03:07 | WARNING: Animation target pose.bones["GRP-Lip_Top not found
19:03:07 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
19:03:07 | WARNING: Animation target pose.bones["FK-Hand not found
19:03:07 | WARNING: Animation target pose.bones["IK-Hand not found
Python: Traceback (most recent call last):
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/__init__.py", line 637, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 46, in save
    json, buffer = __export(export_settings)
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 63, in __export
    __gather_gltf(exporter, export_settings)
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 77, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 39, in gather_gltf2
    animations += __gather_animations(blender_scene, export_settings)
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 83, in __gather_animations
    animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(_blender_object, merged_tracks, len(animations), export_settings)
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 76, in gather_animations
    animation = __gather_animation(blender_action, blender_object, export_settings)
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 125, in __gather_animation
    __link_samplers(animation, export_settings)
  File "/Users/aa/sdk/glTF-Blender-IO/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 208, in __link_samplers
    animation.channels[i].sampler = __append_unique_and_get_index(animation.samplers, channel.sampler)
AttributeError: 'NoneType' object has no attribute 'sampler'

location: <unknown location>:-1

Re-open the issue would be appreciated. Otherwise let me know if I should raise another issue.

Cheers

julienduroure commented 3 years ago

@atteneder I just pushed a fix

atteneder commented 3 years ago

@julienduroure nice!

next obstacle:

07:58:08 | INFO: Starting glTF 2.0 export
07:58:11 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
07:58:11 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
07:58:11 | WARNING: Animation target pose.bones["FK-Hand not found
07:58:11 | WARNING: Animation target pose.bones["GRP-Lip_Top not found
07:58:11 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
07:58:11 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
07:58:11 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
07:58:11 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
07:58:11 | WARNING: Animation target pose.bones["FK-Hand not found
07:58:11 | WARNING: Animation target pose.bones["IK-Hand not found
Python: Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/__init__.py", line 626, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 46, in save
    json, buffer = __export(export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 63, in __export
    __gather_gltf(exporter, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 75, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 39, in gather_gltf2
    animations += __gather_animations(blender_scene, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 83, in __gather_animations
    animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(_blender_object, merged_tracks, len(animations), export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 76, in gather_animations
    animation = __gather_animation(blender_action, blender_object, export_settings)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 114, in __gather_animation
    channels=__gather_channels(blender_action, blender_object, export_settings),
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py", line 149, in __gather_channels
    return gltf2_blender_gather_animation_channels.gather_animation_channels(
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 74, in gather_animation_channels
    channel = __gather_animation_channel(
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 202, in __gather_animation_channel
    sampler=__gather_sampler(channels, blender_object, export_settings, bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj),
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py", line 254, in __gather_sampler
    return gltf2_blender_gather_animation_samplers.gather_animation_sampler(
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py", line 67, in gather_animation_sampler
    input=__gather_input(channels, blender_object_if_armature, non_keyed_values,
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py", line 235, in __gather_input
    keyframes = gltf2_blender_gather_animation_sampler_keyframes.gather_keyframes(blender_object_if_armature,
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py", line 231, in gather_keyframes
    mat = get_bone_matrix(
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 90, in wrapper_bonecache
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py", line 177, in get_bone_matrix
    drivers_to_manage = get_sk_drivers(obj_driver)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 117, in wrapper_skdriverdiscover
    result = func(*args)
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py", line 55, in get_sk_drivers
    idx = shapekeys_idx[sk_name]
KeyError: 'XZ_Wrist_Up.L'
julienduroure commented 3 years ago

Still with same file? I exported it yesterday with Blender 2.93 and master addon, without any crash

atteneder commented 3 years ago

I beg your pardon. My dual-addon setup accidentally fell back to version 1.6.something.

With 1.7.23 the export finishes now!

I cannot view the result in 3 different glTF viewers though (no errors, but scene does not show up at all)....I'll investigate / debug the results now.

Thanks!

atteneder commented 3 years ago

The file contains the main character as a collection instance (CH-rain). The glTF exporter only creates a root level node (named CH-rain), but not the actual character's (rig) full hierarchy.

I tried Apply -> Make Instances Real to work around this. Result:

I assume animated collection instances have never been tested and thus are not supported. Would be great if it was added or otherwise a warning/error shows up (ideally with workaround explanation).

To clarify: this scene/issue is not a high priority to me. Do what you like with my observations, but no pressure from my side.

Thanks!

julienduroure commented 3 years ago

A complete refactoring (for better collection instance management) is in progress in #1378 I will test this file with the #1378 branch

julienduroure commented 3 years ago

Note: With Master branch, I am able to see (not perfect) results in both https://sandbox.babylonjs.com/ and https://gltf-viewer.donmccurdy.com/ What viewer did you use?

atteneder commented 3 years ago

I used Don's viewer as well, the official glTF sample viewer and my own (glTFast/Unity)

I exported with bpy.app.version == (2, 93, 3) and current master ( 1.7.23 - ae019ea5c4fd5b5482393474adbeebb7a37b4aa1 ) with default settings.

Here's the result (JSON part only):

rain_restaurant.gltf.zip

What stands out to me is that node CH-rain_proxy(which I believe is supposed to hold the character mesh) is missing and node CH-rain is empty.

export log:

08:22:15 | INFO: Starting glTF 2.0 export
08:22:15 | INFO: Extracting primitive: Cube.001
08:22:15 | INFO: Primitives created: 1
08:22:15 | INFO: Extracting primitive: Torus.010
08:22:15 | INFO: Primitives created: 1
08:22:15 | INFO: Extracting primitive: Cube.003
08:22:15 | INFO: Primitives created: 2
08:22:15 | INFO: Extracting primitive: Cylinder
08:22:15 | INFO: Primitives created: 2
08:22:15 | INFO: Extracting primitive: Cylinder.001
08:22:15 | INFO: Primitives created: 1
08:22:15 | INFO: Extracting primitive: Cylinder.002
08:22:15 | INFO: Primitives created: 1
08:22:15 | INFO: Extracting primitive: GEO-rain_gums_upper_Data
08:22:17 | INFO: Primitives created: 2
08:22:17 | INFO: Extracting primitive: GEO-rain_gums_lower_Data
08:22:17 | INFO: Primitives created: 2
08:22:17 | INFO: Extracting primitive: GEO-rain_tongue_Data
08:22:17 | INFO: Primitives created: 1
08:22:17 | INFO: Extracting primitive: GEO-rain_eyebrows_Data
08:22:17 | INFO: Primitives created: 1
08:22:17 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:17 | INFO: Extracting primitive: GEO-rain_eyelashes_Data
08:22:17 | INFO: Primitives created: 1
08:22:17 | INFO: Extracting primitive: GEO-rain_head_Data
08:22:18 | INFO: Primitives created: 1
08:22:18 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:18 | INFO: Extracting primitive: GEO-rain_body_Data
08:22:20 | INFO: Primitives created: 1
08:22:20 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:20 | INFO: Extracting primitive: GEO-rain_scarf_Data
08:22:20 | INFO: Primitives created: 1
08:22:20 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:21 | INFO: Extracting primitive: GEO-rain_shoes_Data
08:22:21 | INFO: Primitives created: 4
08:22:21 | INFO: Extracting primitive: Cube
08:22:21 | INFO: Primitives created: 1
08:22:21 | INFO: Extracting primitive: GEO-rain_top_Data
08:22:21 | INFO: Primitives created: 1
08:22:21 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:22 | INFO: Extracting primitive: GEO-rain_jeans_Data
08:22:22 | INFO: Primitives created: 1
08:22:22 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:25 | INFO: Extracting primitive: GEO-rain_body_nomask_Data
08:22:27 | INFO: Primitives created: 2
08:22:27 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:27 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:28 | INFO: Extracting primitive: Sphere.014
08:22:28 | INFO: Primitives created: 1
08:22:28 | INFO: Extracting primitive: Sphere.004
08:22:28 | INFO: Primitives created: 1
08:22:28 | INFO: Extracting primitive: Data_GEO-rain_hair_main
08:22:28 | INFO: Primitives created: 1
08:22:28 | WARNING: There are more than 4 joint vertex influences.The 4 with highest weight will be used (and normalized).
08:22:30 | INFO: Extracting primitive: GEO-rain_hair_ponytail_Data
08:22:30 | INFO: Primitives created: 1
08:22:30 | INFO: Extracting primitive: GEO-rain_hair_strand_Data
08:22:30 | INFO: Primitives created: 1
08:22:30 | INFO: Extracting primitive: GEO-rain_hairband_Data
08:22:30 | INFO: Primitives created: 1
08:22:30 | INFO: Extracting primitive: Sphere.003
08:22:30 | INFO: Primitives created: 3
08:22:31 | INFO: Extracting primitive: Circle
08:22:31 | INFO: Primitives created: 1
08:22:31 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
08:22:31 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Hand not found
08:22:31 | WARNING: Animation target pose.bones["GRP-Lip_Top not found
08:22:31 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Hand not found
08:22:31 | WARNING: Animation target pose.bones["IK-Hand not found
08:22:31 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
08:22:31 | WARNING: Animation target pose.bones["IK-Hand_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Hand not found
08:22:31 | WARNING: Animation target pose.bones["GRP-Lip_Top not found
08:22:31 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Thigh_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Upperarm_Parent not found
08:22:31 | WARNING: Animation target pose.bones["FK-Hand not found
08:22:31 | WARNING: Animation target pose.bones["IK-Hand not found
08:23:16 | INFO: Finished glTF 2.0 export in 61.413681983947754 s

Regards