Export to gltf 2.0 with a bone animation [contains zero scale] raises error #77633

Closed
opened 2020-06-08 19:07:42 +02:00 by Sergei Sobolev · 8 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 446.14

Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: blender/blender@211b6c29f7
Worked: (newest version of Blender that worked as expected)

Short description of error
I can't export to gltf 2.0 with a bone animation.

Exact steps for others to reproduce the error
gltf_anim.blend

  • Open File
  • File > Export > glTF 2.0
Traceback (most recent call last):
  File "/2.83/scripts/addons/io_scene_gltf2/__init__.py", line 506, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 42, in save
    json, buffer = __export(export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 55, in __export
    __gather_gltf(exporter, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 64, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 37, in gather_gltf2
    scenes.append(__gather_scene(blender_scene, export_settings))
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 60, in __gather_scene
    blender_scene, None, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 47, in gather_node
    node = __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 61, in __gather_node
    children=__gather_children(blender_object, blender_scene, export_settings),
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 135, in __gather_children
    blender_scene, None, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 47, in gather_node
    node = __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 61, in __gather_node
    children=__gather_children(blender_object, blender_scene, export_settings),
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 135, in __gather_children
    blender_scene, None, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 47, in gather_node
    node = __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 65, in __gather_node
    mesh=__gather_mesh(blender_object, library, export_settings),
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 333, in __gather_mesh
    export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py", line 44, in gather_mesh
    primitives=__gather_primitives(blender_mesh, library, blender_object, vertex_groups, modifiers, material_names, export_settings),
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py", line 136, in __gather_primitives
    export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py", line 51, in gather_primitives
    vertex_groups, modifiers, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py", line 96, in __gather_cache_primitives
    None, blender_mesh, library, blender_object, vertex_groups, modifiers, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py", line 367, in extract_primitives
    v = convert_swizzle_location(vertex.co, armature, blender_object, export_settings)
  File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py", line 96, in convert_swizzle_location
    apply_matrix = armature.matrix_world.inverted() @ blender_object.matrix_world
ValueError: Matrix.invert(ed): matrix does not have an inverse
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 446.14 **Blender Version** Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: `blender/blender@211b6c29f7` Worked: (newest version of Blender that worked as expected) **Short description of error** I can't export to gltf 2.0 with a bone animation. **Exact steps for others to reproduce the error** [gltf_anim.blend](https://archive.blender.org/developer/F8603615/gltf_anim.blend) - Open File - `File` > `Export` > `glTF 2.0` ``` Traceback (most recent call last): File "/2.83/scripts/addons/io_scene_gltf2/__init__.py", line 506, in execute return gltf2_blender_export.save(context, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 42, in save json, buffer = __export(export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 55, in __export __gather_gltf(exporter, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 64, in __gather_gltf active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 37, in gather_gltf2 scenes.append(__gather_scene(blender_scene, export_settings)) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached result = func(*args) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 60, in __gather_scene blender_scene, None, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 47, in gather_node node = __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached result = func(*args) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 61, in __gather_node children=__gather_children(blender_object, blender_scene, export_settings), File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 135, in __gather_children blender_scene, None, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 47, in gather_node node = __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached result = func(*args) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 61, in __gather_node children=__gather_children(blender_object, blender_scene, export_settings), File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 135, in __gather_children blender_scene, None, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 47, in gather_node node = __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached result = func(*args) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 65, in __gather_node mesh=__gather_mesh(blender_object, library, export_settings), File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 333, in __gather_mesh export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached result = func(*args) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py", line 44, in gather_mesh primitives=__gather_primitives(blender_mesh, library, blender_object, vertex_groups, modifiers, material_names, export_settings), File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py", line 136, in __gather_primitives export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached result = func(*args) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py", line 51, in gather_primitives vertex_groups, modifiers, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 65, in wrapper_cached result = func(*args) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py", line 96, in __gather_cache_primitives None, blender_mesh, library, blender_object, vertex_groups, modifiers, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py", line 367, in extract_primitives v = convert_swizzle_location(vertex.co, armature, blender_object, export_settings) File "/2.83/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py", line 96, in convert_swizzle_location apply_matrix = armature.matrix_world.inverted() @ blender_object.matrix_world ValueError: Matrix.invert(ed): matrix does not have an inverse ```
Author

Added subscriber: @Hrofti

Added subscriber: @Hrofti
Author

It happens if in start animation I have an object or a bone scaled at zero.

It happens if in start animation I have an object or a bone scaled at zero.
Philipp Oeser changed title from I can't export to gltf 2.0 with a bone animation. to Export to gltf 2.0 with a bone animation [contains zero scale] raises error 2020-06-09 12:00:17 +02:00
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscribers: @JulienDuroure, @lichtwerk

Added subscribers: @JulienDuroure, @lichtwerk
Member
CC @JulienDuroure
Member

For information, I open a ticket on upstream issue tracker:
https://github.com/KhronosGroup/glTF-Blender-IO/issues/1087

For information, I open a ticket on upstream issue tracker: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1087
Member

Well, always a bad idea to animate the armature object directly ... and even more to animate a scale at 0 ... Will try to find a workaround

Well, always a bad idea to animate the armature object directly ... and even more to animate a scale at 0 ... Will try to find a workaround
Member

This is now solved by using:

  • Disable "Use Rest Position Armature" in Data > Armature
  • Enable "Use current frame as object rest transformations" in Animation > Rest & Ranges
    And exporting at frame where there is no zero scale (at frame 50 for example)
This is now solved by using: - Disable "Use Rest Position Armature" in Data > Armature - Enable "Use current frame as object rest transformations" in Animation > Rest & Ranges And exporting at frame where there is no zero scale (at frame 50 for example)
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2024-02-24 18:26:56 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#77633
No description provided.