Top menu bar items not accessible with Python #59744

Closed
opened 2018-12-22 04:28:29 +01:00 by Rombout Versluijs · 9 comments

System Information
OSX 10.11.6
Intel Irs Pro 1536

Blender Version
2.80 2018-12-19 #a91886e76ebd

Though is not really a bug i do want to add attention to this. A lot of items in the top bar are not or not properly accessible with Python.

For pre Blender 2.80 i have made 2 addons which allow me to switch render engines real quick using a shortcut. This part still works in 2.80 but other items like render and show render do not. When i use render image from the top menu, a new window opens (according to preset) and render is shown. Yet when i use my addon with the same code this does not happen. The image renders but not new window is opened.

Screen Shot 2018-12-21 at 23.16.01.png

When i use the same python code ops to show the render i get this error

Writing userprefs: '/Users/romboutversluijs/Library/Application Support/Blender/2.80/config/userpref.blend' ok
ERROR (wm.operator): /Users/fsiddi/bin/buildbot-worker/mac_x86_64_10_9_cmake/blender.git/source/blender/windowmanager/intern/wm_event_system.c:1345 wm_operator_invoke: invalid operator call 'RENDER_OT_view_show'

I also made an addon which allow me to use shorts cmd+1-9 to quick switch between now called workspaces, prior Screen Layout. I have been search high and low in the code but i can not find any info what python is used to activate each workspace. Could there be info added or make this accessible with python?

I do get the names, but there are some nameless leftovers in the code i guess. I an earlier version i had to default.00 something showing there and with the build from the 19th there is now 1 left.

Screen Shot 2018-12-21 at 23.25.17.png

To get the screens i used the same function as in bl 2.79 and earlier. Though it does get the names, it seems to be missing something

def avail_screens(self,context):
'''
enumerates available screen layouts and adding more items:
Maximize Area - will toggle current area to maximum window size
User Preferences - opens User Preferences window
'''
screen = bpy.data.screens
screens = [ ("User Preferences", "User Preferences", "User Preferences")
] # (identifier, name, description) optionally: (.., icon name, unique number)

for screen in bpy.data.screens:
screens.append((screen.name, screen.name, screen.name))
return screens

**System Information** OSX 10.11.6 Intel Irs Pro 1536 **Blender Version** 2.80 2018-12-19 #a91886e76ebd Though is not really a bug i do want to add attention to this. A lot of items in the top bar are not or not properly accessible with Python. For pre Blender 2.80 i have made 2 addons which allow me to switch render engines real quick using a shortcut. This part still works in 2.80 but other items like render and show render do not. When i use render image from the top menu, a new window opens (according to preset) and render is shown. Yet when i use my addon with the same code this does not happen. The image renders but not new window is opened. ![Screen Shot 2018-12-21 at 23.16.01.png](https://archive.blender.org/developer/F6031210/Screen_Shot_2018-12-21_at_23.16.01.png) When i use the same python code ops to show the render i get this error > Writing userprefs: '/Users/romboutversluijs/Library/Application Support/Blender/2.80/config/userpref.blend' ok > ERROR (wm.operator): /Users/fsiddi/bin/buildbot-worker/mac_x86_64_10_9_cmake/blender.git/source/blender/windowmanager/intern/wm_event_system.c:1345 wm_operator_invoke: invalid operator call 'RENDER_OT_view_show' > I also made an addon which allow me to use shorts cmd+1-9 to quick switch between now called workspaces, prior Screen Layout. I have been search high and low in the code but i can not find any info what python is used to activate each workspace. Could there be info added or make this accessible with python? I do get the names, but there are some nameless leftovers in the code i guess. I an earlier version i had to default.00 something showing there and with the build from the 19th there is now 1 left. ![Screen Shot 2018-12-21 at 23.25.17.png](https://archive.blender.org/developer/F6031221/Screen_Shot_2018-12-21_at_23.25.17.png) To get the screens i used the same function as in bl 2.79 and earlier. Though it does get the names, it seems to be missing something > def avail_screens(self,context): > ''' > enumerates available screen layouts and adding more items: > Maximize Area - will toggle current area to maximum window size > User Preferences - opens User Preferences window > ''' > screen = bpy.data.screens > screens = [ ("User Preferences", "User Preferences", "User Preferences") > ] # (identifier, name, description) optionally: (.., icon name, unique number) > > for screen in bpy.data.screens: > screens.append((screen.name, screen.name, screen.name)) > return screens

Added subscriber: @RomboutVersluijs

Added subscriber: @RomboutVersluijs

After doing more seaches i found this thread on BA, https://blenderartists.org/t/access-to-workspace-areas/1137024/4

It didnt work but i kept trying. Im now able to switch again using the popup menu and adding shortcuts using this line;

bpy.context.window.workspace = bpy.data.workspaces[self.layoutItems1]

It would help if the top menu bar showed Python info though. It seems this is one of the few sections which does not or hardly show any info

After doing more seaches i found this thread on BA, https://blenderartists.org/t/access-to-workspace-areas/1137024/4 It didnt work but i kept trying. Im now able to switch again using the popup menu and adding shortcuts using this line; > bpy.context.window.workspace = bpy.data.workspaces[self.layoutItems1] It would help if the top menu bar showed Python info though. It seems this is one of the few sections which does not or hardly show any info

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2018-12-24 00:23:03 +01:00

For the first issue, please try asking on support forums or devtalk first. If you provide no exact steps for developers to reproduce the issue, it's not a bug to be investigated.

For the first issue, please try asking on support forums or devtalk first. If you provide no exact steps for developers to reproduce the issue, it's not a bug to be investigated.

That why i stated it technically not a bug. But adding this to a forum will not get proper feedback. The Top bar acts different in a couple ways.

Using the view render command from the 3d viewport for instance. It give this error.

Traceback (most recent call last):
  File "/Applications/blender-2.80.0-git20181222.f1f8859ad52b-x86_64/blender.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable
    raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring")
Exception: Add-on 'io_import_scene_lwo' has not been upgraded to 2.8, ignoring
ERROR (wm.operator): /Users/fsiddi/bin/buildbot-worker/mac_x86_64_10_9_cmake/blender.git/source/blender/windowmanager/intern/wm_event_system.c:1345 wm_operator_invoke: invalid operator call 'RENDER_OT_view_show'


The workspace tabs dont show any python info as do many other menu items. This is probably due to the new right click options we have.

That why i stated it technically not a bug. But adding this to a forum will not get proper feedback. The Top bar acts different in a couple ways. Using the view render command from the 3d viewport for instance. It give this error. ``` Traceback (most recent call last): File "/Applications/blender-2.80.0-git20181222.f1f8859ad52b-x86_64/blender.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 377, in enable raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring") Exception: Add-on 'io_import_scene_lwo' has not been upgraded to 2.8, ignoring ERROR (wm.operator): /Users/fsiddi/bin/buildbot-worker/mac_x86_64_10_9_cmake/blender.git/source/blender/windowmanager/intern/wm_event_system.c:1345 wm_operator_invoke: invalid operator call 'RENDER_OT_view_show' ``` The workspace tabs dont show any python info as do many other menu items. This is probably due to the new right click options we have.

If you want the show render thing to be investigated as a bug, you need to provide exact steps to reproduce it. For example by providing a simple example script and instructions on how to run it.

The workspace tabs not showing python info is not a bug.

If you want the show render thing to be investigated as a bug, you need to provide exact steps to reproduce it. For example by providing a simple example script and instructions on how to run it. The workspace tabs not showing python info is not a bug.
Okay done, https://developer.blender.org/T59832

PS is there a reason why top menu doesnt show Python info?

PS is there a reason why top menu doesnt show Python info?
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 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#59744
No description provided.