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

Python exception when exporting NLA tracks while editing an NLA track #2477

Open
sjkillen opened this issue Jan 30, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@sjkillen
Copy link

Describe the bug
Exporting while editing an animation in an NLA track produces an error

To Reproduce
Steps to reproduce the behavior:

  1. Create mesh with rig
  2. Create an NLA track with simple animation
  3. Click the animation in the track and press tab to edit it.
  4. Export with export_animation_mode="NLA_TRACKS"
  5. See error

.blend file/ .gltf (mandatory)

issue.zip

Open file and run included script from text window

Version

- OS: Linux
- Blender Version: 4.4 alpha (47bc05f7ae59)

Additional context
Resulting error:

Read blend: "/home/rat/Downloads/issue/Untitled.blend"
INFO Draco mesh compression is available, use library at /home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/libextern_draco.so
19:57:20 | INFO: Starting glTF 2.0 export
19:57:20 | INFO: Extracting primitive: Cube
19:57:20 | INFO: Primitives created: 1
Traceback (most recent call last):
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/__init__.py", line 1356, in execute
    res = gltf2_blender_export.save(context, export_settings)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 37, in save
    json, buffer = __export(export_settings)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 55, in __export
    __gather_gltf(exporter, export_settings)
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 202, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/gather.py", line 35, in gather_gltf2
    animations += gather_animations(export_settings)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/animation/animations.py", line 22, in gather_animations
    return gather_tracks_animations(export_settings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/animation/tracks.py", line 69, in gather_tracks_animations
    animations_, merged_tracks = gather_track_animations(obj_uuid, merged_tracks, len(animations), export_settings)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/animation/tracks.py", line 150, in gather_track_animations
    blender_object.animation_data.action = None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: bpy_struct: attribute "action" from "AnimData" is read-only
Error: Python: Traceback (most recent call last):
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/__init__.py", line 1356, in execute
    res = gltf2_blender_export.save(context, export_settings)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 37, in save
    json, buffer = __export(export_settings)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 55, in __export
    __gather_gltf(exporter, export_settings)
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 202, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
                                           ^^^^^^^^^^^^^^^^^^^^^Error: Python: Traceback (most recent call last):
  File "/home/rat/Downloads/issue/Untitled.blend/Text", line 3, in <module>
  File "/home/rat/blender-git/build_linux_full/bin/4.4/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 "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/__init__.py", line 1356, in execute
    res = gltf2_blender_export.save(context, export_settings)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 37, in save
    json, buffer = __export(export_settings)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 55, in __export
    __gather_gltf(exporter, export_settings)
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/export.py", line 202, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/gather.py", line 35, in gather_gltf2
    animations += gather_animations(export_settings)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/animation/animations.py", line 22, in gather_animations
    return gather_tracks_animations(export_settings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/animation/tracks.py", line 69, in gather_tracks_animations
    animations_, merged_tracks = gather_track_animations(obj_uuid, merged_tracks, len(animations), export_settings)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rat/blender-git/build_linux_full/bin/4.4/scripts/addons_core/io_scene_gltf2/blender/exp/animation/tracks.py", line 150, in gather_track_animations
    blender_object.animation_data.action = None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: bpy_struct: attribute "action" from "AnimData" is read-only
Location: /home/rat/blender-git/build_linux_full/bin/4.4/scripts/modules/bpy/ops.py:109
@julienduroure
Copy link
Collaborator

Confirmed.
The tweak mode check that is done on Action mode is not implement for NLA Track mode.

(Note that Action mode also crash for now, for a not related reason)

@julienduroure julienduroure added the bug Something isn't working label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants