Runtime syntax error when attempting to select object #66885

Closed
opened 2019-07-13 22:31:01 +02:00 by Xavier Bergeron · 10 comments

System Information
Operating system: Windows 10
Graphics card: GTX 1050 Ti

Blender Version
version: 2.80 (sub 74), branch: master, commit date: 2019-06-29 20:58, hash: be060c3990, type: Release
build date: 29/06/2019, 17:58

Short description of error

Traceback (most recent call last):
  File "C:\Users\Xavier\Desktop\blender-2.80.0-git.dd3f5186260e-windows64\2.80\scripts\startup\bl_operators\wm.py", line 524, in execute
    value = context_path_validate(context, data_path)
  File "C:\Users\Xavier\Desktop\blender-2.80.0-git.dd3f5186260e-windows64\2.80\scripts\startup\bl_operators\wm.py", line 83, in context_path_validate
    value = eval("context.%s" % data_path) if data_path else Ellipsis
  File "<string>", line 1
    context.(null).shading.type
            ^
SyntaxError: invalid syntax

location: <unknown location>:-1

location: <unknown location>:-1

Exact steps for others to reproduce the error
Edit:

  • Default startup file, load factory settings
  • Right click one of the show X-Ray shading.show_xray / Shading option toggle buttons at the top right and click assign shortcut and left click (Or right click depending on your select key map) inside the Press a key button ( Image: https://xavie.ru/i/2jee3et.png )
  • Left/right click in the viewport, dope sheet, UV editor, shader graph and the error should occur
  • Notice now as well that we are unable to re-assign the shortcut for this particular action through the context menu: ( Image: https://xavie.ru/i/2jywAjH.png )

After exporting the keymap, this can be found:

    ("wm.context_menu_enum",
     {"type": 'RIGHTMOUSE', "value": 'PRESS'},
     {"properties":
      [("data_path", '(null).shading.type'),
       ],
      },
     ),
**System Information** Operating system: Windows 10 Graphics card: GTX 1050 Ti **Blender Version** version: 2.80 (sub 74), branch: master, commit date: 2019-06-29 20:58, hash: be060c3990ad, type: Release build date: 29/06/2019, 17:58 **Short description of error** ``` Traceback (most recent call last): File "C:\Users\Xavier\Desktop\blender-2.80.0-git.dd3f5186260e-windows64\2.80\scripts\startup\bl_operators\wm.py", line 524, in execute value = context_path_validate(context, data_path) File "C:\Users\Xavier\Desktop\blender-2.80.0-git.dd3f5186260e-windows64\2.80\scripts\startup\bl_operators\wm.py", line 83, in context_path_validate value = eval("context.%s" % data_path) if data_path else Ellipsis File "<string>", line 1 context.(null).shading.type ^ SyntaxError: invalid syntax location: <unknown location>:-1 location: <unknown location>:-1 ``` **Exact steps for others to reproduce the error** **Edit:** - Default startup file, load factory settings - Right click one of the show X-Ray `shading.show_xray` / Shading option toggle buttons at the top right and click `assign shortcut` and left click (Or right click depending on your select key map) _inside_ the `Press a key` button ( Image: https://xavie.ru/i/2jee3et.png ) - Left/right click in the viewport, dope sheet, UV editor, shader graph and the error should occur - Notice now as well that we are unable to re-assign the shortcut for this particular action through the context menu: ( Image: https://xavie.ru/i/2jywAjH.png ) After exporting the keymap, this can be found: ``` ("wm.context_menu_enum", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, {"properties": [("data_path", '(null).shading.type'), ], }, ), ```

Added subscriber: @xaviergmail

Added subscriber: @xaviergmail

I've upgraded to the latest 2.8 RC build and the issue persists.

I've upgraded to the latest 2.8 RC build and the issue persists.

Added subscriber: @GavinScott

Added subscriber: @GavinScott

To get the Assign Shortcut to work properly, you need to never click on the Press a Key button, as doing so will try to assign the mouse click as the shortcut, hijacking your left (or right) click action which generally makes a mess out of things, and you're prevented from changing it back as you saw.

Just pass the mouse over the pop-up which will cause it to switch to the blue Press a Key state at which point you can press the key that you want to have as the shortcut, and things should work without issue.

We really should do something to stop people from clicking on that thing!

To get the Assign Shortcut to work properly, you need to never click on the Press a Key button, as doing so will try to assign the mouse click as the shortcut, hijacking your left (or right) click action which generally makes a mess out of things, and you're prevented from changing it back as you saw. Just pass the mouse over the pop-up which will cause it to switch to the blue Press a Key state at which point you can press the key that you want to have as the shortcut, and things should work without issue. We really should do something to stop people from clicking on that thing!

Absolutely agree on adding at least some sort of warning or confirmation popup.

I was unable to remove the keybinding from my settings afterwards. I tried exporting the keymap, removing the defunct bind and re-importing, but the bind still persisted so I resorted to clearing out my user settings entirely and started anew. Thankfully I hadn't done much customization.

Absolutely agree on adding at least some sort of warning or confirmation popup. I was unable to remove the keybinding from my settings afterwards. I tried exporting the keymap, removing the defunct bind and re-importing, but the bind still persisted so I resorted to clearing out my user settings entirely and started anew. Thankfully I hadn't done much customization.

Closed as duplicate of #65397

Closed as duplicate of #65397

Added subscriber: @Destic

Added subscriber: @Destic

Just made an account to add this little piece. You can fix it by going to Edit->Preferences->Keymap. Then open the "Window" Tab and go to the bottom of it.blender_OAyqb17V6T.png The "Context Toggle" is the accidental shortcut that was set for the Xray. Remove it and everything should work again. This way you don't have to remove everything you've previously added (if you haven't saved your settings before that is). This doesn't happen because of left or right clicking, its happens with any shortcut you try to assign to the Xray Toggle via rightclicking the setting & assigning it.
If you want to set a Shortcut for the Xray Toggle, just write "xray" into the searchbar of the Keymap page and you'll find it.

Just made an account to add this little piece. You can fix it by going to Edit->Preferences->Keymap. Then open the "Window" Tab and go to the bottom of it.![blender_OAyqb17V6T.png](https://archive.blender.org/developer/F7626608/blender_OAyqb17V6T.png) The "Context Toggle" is the accidental shortcut that was set for the Xray. Remove it and everything should work again. This way you don't have to remove everything you've previously added (if you haven't saved your settings before that is). This doesn't happen because of left or right clicking, its happens with any shortcut you try to assign to the Xray Toggle via rightclicking the setting & assigning it. If you want to set a Shortcut for the Xray Toggle, just write "xray" into the searchbar of the Keymap page and you'll find it.

Added subscriber: @rdllngr

Added subscriber: @rdllngr

Same problem:

When I try to assimilate a keyboard shortcut to X-Ray via rightclicking, Blender brings me back to this error in the image below after executing the shortcut.

Untitled99.png

The solution I found:

In #66885#733547, @Destic wrote:
If you want to set a Shortcut for the Xray Toggle, just write "xray" into the searchbar of the Keymap page and you'll find it.

I couldn't get results for "xray" in Keymap searchbar, however I was able to create the shortcut manually in Keymap > Window > Add New with the Context Attribute space_data.shading.show_xray (see below):

Untitled98.png

The only problem is that it only works on solid mode. Now how do I get it to work in wireframe mode too?

**Same problem:** When I try to assimilate a keyboard shortcut to X-Ray via rightclicking, Blender brings me back to this error in the image below after executing the shortcut. ![Untitled99.png](https://archive.blender.org/developer/F7639840/Untitled99.png) **The solution I found:** > In #66885#733547, @Destic wrote: > If you want to set a Shortcut for the Xray Toggle, just write "xray" into the searchbar of the Keymap page and you'll find it. I couldn't get results for "xray" in Keymap searchbar, however I was able to create the shortcut manually in Keymap > Window > Add New with the Context Attribute *space_data.shading.show_xray* (see below): ![Untitled98.png](https://archive.blender.org/developer/F7639909/Untitled98.png) The only problem is that it only works on solid mode. Now how do I get it to work in wireframe mode too?
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
5 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#66885
No description provided.