Page MenuHome

Editors change bug in built in menu's
Closed, ResolvedPublic

Description

System Information
Operating system: Windows 10
Graphics card: Nvidia GeForce GTX 965M

Blender Version
2.80, release candidate 1, blender2.8, 18-07-2019

Short description of error
When trying to select Preferences or Timeline editor with the 3D viewport Pie Menus add-on (Ctrl-Alt-S), the editors don't appear, an error message is displayed, and the data-block menus Scene and View Layer in the top bar disappear.

Exact steps for others to reproduce the error
Based on the default startup: go to Preferences>Add-ons>Pie Menus; enable "3D Viewport Pie Menus" add-on; enable "Editor Switch Pie: Hotkey: Ctrl Alt S"; in any editor, press Ctrl Alt S and select Preferences or Timeline.

Details

Type
Bug

Event Timeline

Brendon Murphy (meta-androcto) triaged this task as Confirmed, High priority.

hi this seems to be a bug in Blender. I'm getting

bpy.context.area.ui_type = '<UNKNOWN ENUM>
```'
 from the Info editor window when changing to the timeline or preferences the built in editor menu's.
Brendon Murphy (meta-androcto) renamed this task from Preferences AND Timeline editors Bug in 3D viewport Pie Menus add-on to Editors change bug in 3D viewport and Pie Menus add-on.Jul 22 2019, 4:58 PM
Brendon Murphy (meta-androcto) renamed this task from Editors change bug in 3D viewport and Pie Menus add-on to Editors change bug in built in menu's and Pie Menus add-on.

USER_PREFERENCES -> PREFERENCES renaming should be done in the add-on though.

Hi, I'm finding more editor types misbehaving.
To reproduce, user the info editor to read results and another window to test. Changing the editor types reports with several editors:

Traceback (most recent call last):
  File "C:\Users\Dell\Downloads\blender-2.80-22_07_19-win64\2.80\scripts\addons\space_view3d_pie_menus\pie_editor_switch_menu.py", line 111, in execute
    context.area.type = self.types
TypeError: bpy_struct: item.attr = val: enum "USER_PREFERENCES" not found in (, 'VIEW_3D', 'IMAGE_EDITOR', 'NODE_EDITOR', 'SEQUENCE_EDITOR', 'CLIP_EDITOR', 'DOPESHEET_EDITOR', 'GRAPH_EDITOR', 'NLA_EDITOR', 'TEXT_EDITOR', 'CONSOLE', 'INFO', 'OUTLINER', 'PROPERTIES', 'FILE_BROWSER', 'PREFERENCES')

location: <unknown location>:-1

The <UNKNOWN ENUM> thing is a bug in Blender, but that USER_PREFERENCES error is in the add-on.

@Brecht Van Lommel (brecht) I've fixed the error with User Preferences to > Preferences. There is still an issue with the Timeline and <UNKNOWN ENUM>. I've found in Blender ui if you call it twice it works sometimes, but the whole area "Editor Menu" seems buggy.

bpy.context.area.ui_type = '<UNKNOWN ENUM>'
bpy.context.area.ui_type = 'TIMELINE'

TIMELINE is now DOPESHEET_EDITOR with its mode set to TIMELINE. The Add-on may be better off using the Area.ui_type enum though (see https://docs.blender.org/api/current/bpy.types.Area.html#bpy.types.Area.ui_type), which is the same enum used for generating the regular editor dropdown and includes all the editor sub-types.

Brendon Murphy (meta-androcto) lowered the priority of this task from Confirmed, High to Confirmed, Medium.

commented out reference to the timeline in pie menu addon. beb30514b441 leaving open if blender devs wish to follow up.

Brendon Murphy (meta-androcto) renamed this task from Editors change bug in built in menu's and Pie Menus add-on to Editors change bug in built in menu's.Jul 23 2019, 2:29 PM

hi, there's issues here with the timelne. It's still a stand alone editor type in start up.
there's no reference to the timeline in the graph editor as the docs suggest.
bpy.context.area.ui_type = '<UNKNOWN ENUM>'is bugging the Built In editor menus.
bpy.context.area.ui_type = 'TIMELINE' is still in the menu and will switch to the timeline, often on second attempt.
TIMELINE could be added back as an Editor type to prevent this error.

hi, there's issues here with the timelne. It's still a stand alone editor type in start up.

Versioning is a bit difficult for this. Can't avoid some tradeoffs.

there's no reference to the timeline in the graph editor as the docs suggest.

You mean in the UI and in the Dopesheet? The timeline is not exposed as a mode of the dopesheet in the UI. See SpaceDopeSheetEditor.mode vs. SpaceDopeSheetEditor.ui_mode.

bpy.context.area.ui_type = '<UNKNOWN ENUM>'is bugging the Built In editor menus.

As @Brecht Van Lommel (brecht) pointed out, this is a bug in Blender. Submitted fix, D5325.

bpy.context.area.ui_type = 'TIMELINE' is still in the menu and will switch to the timeline, often on second attempt.

It is in Area.ui_type, however this Add-on uses Area.type with types not available there - which is the breaking issue.

TIMELINE could be added back as an Editor type to prevent this error.

Like I explained in blender.chat, this can not be done (I assume you mean re-enabling it in the Area.type enum?). The enum is only for real editor types, and must not contain the sub-types. Internal code will become broken otherwise. Where these are needed, Area.ui_type should be used.

Hi guys, thanks for the quick answers and taking care of this, hope it will be fixed soon.
I updated the description because I just noticed that when the error messages are displayed, the Scene and View layer data-block menus in the topbar disappear, with no possibility to bring them back unless restarting Blender (on the right side there's an arrow like the ones that appear when you collapse for example the tools sidebar, but it's impossible to click and/or drag). I added a new picture showing the result. I'm pretty new to the Blender community, I thought this update should have had to remain in this same bug notification, or do you suggest to create a new task by itself only for this?

Thanks for your time!

The UNKNOWN ENUM print should be fixed with rBb7f86ff7227.
I guess this report can be closed. Although I'd still suggest to use Area.ui_type rather than Area.type for this add-on.

@David (Geronimooo) this kind of stuff happens when a Python script fails. The Python UI definition simply aborts in case of failure, meaning the UI will be missing remaining items.

closing as resolved, addon is fixed, ui is fixed.