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

Scripts/Add-ons fail to run if a Blender's non-3D Viewport-based editor area is maximized #106

Open
ZeroGravitasIndeed opened this issue Aug 1, 2021 · 0 comments

Comments

@ZeroGravitasIndeed
Copy link

ZeroGravitasIndeed commented Aug 1, 2021

Attempting to run an add-on or a script while a Blender's non-3D editor area (e.g, the Node Editor) is maximized via View ‣ Area ‣ Toggle Maximize Area, produces the following error report:

Traceback (most recent call last):
  File "/Users/myusername/.vscode/extensions/jacqueslucke.blender-development-0.0.16/pythonFiles/include/blender_vscode/utils.py", line 22, in always
    try: func()
  File "/Users/myusername/.vscode/extensions/jacqueslucke.blender-development-0.0.16/pythonFiles/include/blender_vscode/operators/script_runner.py", line 23, in run_script_action
    context = prepare_script_context(path)
  File "/Users/myusername/.vscode/extensions/jacqueslucke.blender-development-0.0.16/pythonFiles/include/blender_vscode/operators/script_runner.py", line 49, in prepare_script_context
    context["space_data"] = context["area"].spaces.active
AttributeError: 'NoneType' object has no attribute 'spaces'

The nature of the script's code doesn't seem to matter (for example, a single import bpy line one fails, too).

If the maximized area is the 3D Viewport, no matter in which mode (object, sculpt, etc.), everything works correctly.

Certainly, this is only a minor nuisance in this truly a lifesaver of a VSCode extension of yours, but, just in case… 🙂

(My setup's details:

Blender 2.93.1
blender_vscode v0.0.16
Visual Studio Code 1.58.2
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:09:06.581Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 18.7.0
macOS 10.14.6 Mojave)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant