Skip to content

Extract Playblast: AttributeError: 'SpaceTextEditor' object has no attribute 'camera' #216

Description

@BigRoy

Is there an existing issue for this?

  • I have searched the existing issues and added correct labels.

Description

Current Behavior

When performing review publishes it may fail if you're in e.g. Scripting layout and the logic finds a different editor than expected, like the SpaceTextEditor

For example:

Traceback (most recent call last):
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\dependency_packages\ayon_2510091624_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "D:\ayon-addon_template\ayon-blender\client\ayon_blender\plugins\publish\extract_playblast.py", line 89, in process
    path = capture(**preset)
           ^^^^^^^^^^^^^^^^^
  File "D:\ayon-addon_template\ayon-blender\client\ayon_blender\api\capture.py", line 87, in capture
    applied_view(window, camera, isolate, options=display_options)
  File "D:\ayon-addon_template\ayon-blender\client\ayon_blender\api\capture.py", line 175, in applied_view
    space.camera = window.scene.objects.get(camera)
    ^^^^^^^^^^^^
AttributeError: 'SpaceTextEditor' object has no attribute 'camera'

Expected Behavior

It should work, regardless of the current user's layout.

Steps To Reproduce:

  1. Go to scripting layout
  2. Activate script editor
  3. Publish review

Additional context:

Version

ayon-blender 1.0.11

What platform were you running when you found the bug?

Windows 11

Relevant log output:

Traceback (most recent call last):
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\dependency_packages\ayon_2510091624_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "D:\ayon-addon_template\ayon-blender\client\ayon_blender\plugins\publish\extract_playblast.py", line 89, in process
    path = capture(**preset)
           ^^^^^^^^^^^^^^^^^
  File "D:\ayon-addon_template\ayon-blender\client\ayon_blender\api\capture.py", line 87, in capture
    applied_view(window, camera, isolate, options=display_options)
  File "D:\ayon-addon_template\ayon-blender\client\ayon_blender\api\capture.py", line 175, in applied_view
    space.camera = window.scene.objects.get(camera)
    ^^^^^^^^^^^^
AttributeError: 'SpaceTextEditor' object has no attribute 'camera'

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions