Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export_scene.gltf throws exception when Color Attribute is being used #2325

Open
bachirelkhoury opened this issue Aug 21, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@bachirelkhoury
Copy link

bachirelkhoury commented Aug 21, 2024

Describe the bug
When exporting a scene where a mesh has a Vertex Color Attribute assigned, the Exception is being thrown.

  • Blender 4.1: The export_scene works as expected - No issues there.
  • Blender 4.2 LTS has this issue.
  • Blender 4.2 LTS exception goes away if I delete the Color Attribute then export.
Python: Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/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 "/Applications/Blender.app/Contents/Resources/4.2/scripts/addons_core/io_scene_gltf2/__init__.py", line 1288, in execute
    res = gltf2_blender_export.save(context, export_settings)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Blender.app/Contents/Resources/4.2/scripts/addons_core/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 37, in save
    json, buffer = __export(export_settings)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Blender.app/Contents/Resources/4.2/scripts/addons_core/io_scene_gltf2/blender/exp/gltf2_blender_export.py", line 65, in __export
    __detect_animated_extensions(exporter.glTF.to_dict(), export_settings)
                                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Blender.app/Contents/Resources/4.2/scripts/addons_core/io_scene_gltf2/io/com/gltf2_io.py", line 1180, in to_dict
    result["accessors"] = from_union([lambda x: from_list(lambda x: to_class(Accessor, x), x), from_none],
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Blender.app/Contents/Resources/4.2/scripts/addons_core/io_scene_gltf2/io/com/gltf2_io.py", line 46, in from_union
    assert False
AssertionError
Location: /Applications/Blender.app/Contents/Resources/4.2/scripts/modules/bpy/ops.py:109

To Reproduce
Steps to reproduce the behavior:

  1. Open the attached Blender file in Blender 4.2 or 4.2.1 LTS then Click on Scripting
  2. Select TestExportGLTF
  3. Select "base_mesh" object
  4. Run the script

Expected behavior
I expect the selected object to be exported to gltf succesfully.

Screenshots
image

See file attached:
test-verext-color-exception.blend.zip

Version

  • OS: macOS
  • Blender Version 4.2 and 4.2.1 LTS have the issue
  • Blender Version 4.1 works fine
@julienduroure
Copy link
Collaborator

Confirmed.
This is a duplicate of #2319
Bug is on loose edges & loose vertices

@julienduroure julienduroure added the duplicate This issue or pull request already exists label Aug 21, 2024
julienduroure added a commit that referenced this issue Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants