Can not call bpy.ops.export_scene.gltf when running Blender in the background (no UI) #83188

Closed
opened 2020-11-29 15:18:12 +01:00 by Jan Wilmaers · 6 comments

System Information
Operating system: OS X Big Sur
Graphics card:

Blender Version
Broken: 2.91
Worked: 2.90.1

Short description of error

Traceback (most recent call last):

File "/Applications/Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_gltf2/__init__.py", line 76, in on_export_format_changed
  operator = sfile.active_operator

AttributeError: 'NoneType' object has no attribute 'active_operator'
File "/Applications/Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_gltf2/init.py", line 73, in on_export_format_changed

Exact steps for others to reproduce the error

- Export to gltf
- https://docs.blender.org/api/current/bpy.ops.export_scene.html
  basedir = os.path.dirname(bpy.data.filepath) # get the path where the blend file is located
  filepath = os.path.join(basedir, 'test.gltf')
    - BREAKS in Blender 2.91
- Expects to be called from UI
  bpy.ops.export_scene.gltf(
      export_format = 'GLTF_EMBEDDED',
      filepath = filepath,
      export_materials = True,
      export_cameras = True,
      export_lights = True,
      export_apply = True)
**System Information** Operating system: OS X Big Sur Graphics card: **Blender Version** Broken: 2.91 Worked: 2.90.1 **Short description of error** Traceback (most recent call last): ``` File "/Applications/Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_gltf2/__init__.py", line 76, in on_export_format_changed operator = sfile.active_operator ``` AttributeError: 'NoneType' object has no attribute 'active_operator' File "/Applications/Blender.app/Contents/Resources/2.91/scripts/addons/io_scene_gltf2/__init__.py", line 73, in on_export_format_changed **Exact steps for others to reproduce the error** - Export to gltf - https://docs.blender.org/api/current/bpy.ops.export_scene.html ``` basedir = os.path.dirname(bpy.data.filepath) # get the path where the blend file is located filepath = os.path.join(basedir, 'test.gltf') ``` - BREAKS in Blender 2.91 - Expects to be called from UI ``` bpy.ops.export_scene.gltf( export_format = 'GLTF_EMBEDDED', filepath = filepath, export_materials = True, export_cameras = True, export_lights = True, export_apply = True)
Author

Added subscriber: @jan_wilmaers

Added subscriber: @jan_wilmaers
Jan Wilmaers changed title from Can not call bpy.ops.export_scene.gltf when running Blender in the background (no U) to Can not call bpy.ops.export_scene.gltf when running Blender in the background (no UI) 2020-11-29 15:18:41 +01:00
Member

Added subscriber: @JulienDuroure

Added subscriber: @JulienDuroure
Member

I created a ticket in upstream repository: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1281

I created a ticket in upstream repository: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1281
Julien Duroure self-assigned this 2020-12-03 10:46:51 +01:00
Member

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

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

This issue was referenced by c5a84e2e1a

This issue was referenced by c5a84e2e1ad002f55ace47eeefe4f7deedeb75b5
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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#83188
No description provided.