GLTF exporter fails with IndexError in primitive_creation #104852
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104852
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Ubuntu Linux
Graphics card: 5700xt
Blender Version
Broken: 3.6.2
Short description of error
Exporting a cell fracture animation as GLB throws an error.
Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).
Have attached a blend file
I did a similar animation on a different mesh last week and it worked, so my assumption is this mesh is stranger or has some quirk.
Call stack
``` Python: Traceback (most recent call last): File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/__init__.py", line 852, in execute return gltf2_blender_export.save(context, export_settings) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 34, in save json, buffer = __export(export_settings) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 51, in __export __gather_gltf(exporter, export_settings) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 65, in __gather_gltf active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 28, in gather_gltf2 scenes.append(__gather_scene(blender_scene, export_settings)) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 35, in wrapper_cached result = func(*args, **kwargs) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py", line 69, in __gather_scene node = gltf2_blender_gather_nodes.gather_node( File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 34, in gather_node mesh=__gather_mesh(vnode, blender_object, export_settings), File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py", line 242, in __gather_mesh result = gltf2_blender_gather_mesh.gather_mesh(blender_mesh, File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 35, in wrapper_cached result = func(*args, **kwargs) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py", line 57, in gather_mesh primitives=__gather_primitives(blender_mesh, uuid_for_skined_data, vertex_groups, modifiers, materials, export_settings), File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py", line 134, in __gather_primitives return gltf2_blender_gather_primitives.gather_primitives(blender_mesh, File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 35, in wrapper_cached result = func(*args, **kwargs) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py", line 63, in gather_primitives blender_primitives = __gather_cache_primitives(blender_mesh, uuid_for_skined_data, File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py", line 35, in wrapper_cached result = func(*args, **kwargs) File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py", line 131, in __gather_cache_primitives blender_primitives = gltf2_blender_gather_primitives_extract.extract_primitives( File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives_extract.py", line 24, in extract_primitives return primitive_creator.primitive_creation() File "/snap/blender/3915/3.6/scripts/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives_extract.py", line 387, in primitive_creation self.prim_dots = self.dots[dot_indices] IndexError: index 18389 is out of bounds for axis 0 with size 18383 ```Originally reported at: blender/blender#111598
Hello,
Please provide the .blend file you are trying to export.
@JulienDuroure hi, it is provided in original report 😅 : blender/blender#111598
Anyways, uploading here: test file
Here is a simpler file with no animation, and only the object responsible of the backtrace.
Seems the cell fracture does not generate a valid mesh here, as bpy.context.object.data.validate() returns True.
glTF can't export it correctly, as the mesh is not valid. Let's add a check, and skip this primitive/mesh
Indeed, mesh is corrupted.
So, are you adding a condition
mesh.validate
to skip invalid geometries?We already have a mesh.validate, that sometime solve the mesh issue, and let export some part of the mesh, depending the initial issue on the mesh.
My proposition is to add a Warning when validate() changed the mesh, and omit invalid geometry only in case we can't export anything.
Here is the PR : https://github.com/KhronosGroup/glTF-Blender-IO/pull/1977/files