Python - operator called by gizmo always called the invoke() from the combination ALT + LEFTMOUSE (also asserts) #77810

Open
opened 2020-06-12 19:29:49 +02:00 by Cédric · 14 comments
Member

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.87

Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 12:23, hash: 82e3bd4bbb

Short description of error
When an operator is called by a gizmo, the combination of the event ALT or CTRL or SHIFT + LEFTMOUSE always initialize the operator by calling the invoke().
Other combination of keys + LEFTMOUSE does not call the invoke()
This problem makes impossible to take into account the industry compatible keymap in the 3dview with the target_set_operator in gizmo.

Exact steps for others to reproduce the error
Open the file gizmo_operator_invoke.blend

  • Toggle the system console to view the prints
  • Run the script :
    • In the 3dView, click once on the gizmo (gizmo now follows you mouse)
    • now press {key Alt} and start clicking -- using the combination ALT+LEFTMOUSE will call invoke() [inspect in the console] each time
      • use RIGHTCLICK or ESC repeatedly to stop the modal (if you clicked multiple times you have to do {key RMB} multiple times as well )
    • now press {key S} and start clicking -- use the combination "S"+LEFTMOUSE will not call invoke() [inspect in the console] each time
      • use RIGHTCLICK or ESC a single time to stop the modal

Note: in a Debug build, an Assert should be triggered when pressing {key Alt} and start clicking

BLI_assert failed: source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c:1068, wm_gizmomap_modal_set(), at 'gzmap->gzmap_context.modal == ((void *)0)'

Thanks for your help

gizmo_operator_invoke_phi.blend

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.87 **Blender Version** Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 12:23, hash: `82e3bd4bbb` **Short description of error** When an operator is called by a gizmo, the combination of the event ALT or CTRL or SHIFT + LEFTMOUSE always initialize the operator by calling the invoke(). Other combination of keys + LEFTMOUSE does not call the invoke() This problem makes impossible to take into account the industry compatible keymap in the 3dview with the target_set_operator in gizmo. **Exact steps for others to reproduce the error** Open the file gizmo_operator_invoke.blend - Toggle the system console to view the prints - Run the script : - In the 3dView, click once on the gizmo (gizmo now follows you mouse) - now press {key Alt} and start clicking -- using the combination ALT+LEFTMOUSE will call invoke() [inspect in the console] each time - use RIGHTCLICK or ESC repeatedly to stop the modal (if you clicked multiple times you have to do {key RMB} multiple times as well ) - now press {key S} and start clicking -- use the combination "S"+LEFTMOUSE will **not** call invoke() [inspect in the console] each time - use RIGHTCLICK or ESC a single time to stop the modal Note: in a Debug build, an Assert should be triggered when pressing {key Alt} and start clicking ``` BLI_assert failed: source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c:1068, wm_gizmomap_modal_set(), at 'gzmap->gzmap_context.modal == ((void *)0)' ``` Thanks for your help [gizmo_operator_invoke_phi.blend](https://archive.blender.org/developer/F8638918/gizmo_operator_invoke_phi.blend)
Author
Member

Added subscriber: @Clarkx

Added subscriber: @Clarkx
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

use the combination "S"+LEFTMOUSE

First of all, I am getting this

Error: Traceback (most recent call last):
  File "/gizmo_operator_invoke.blend/Text", line 53, in modal
  File "//scripts/modules/bpy_types.py", line 713, in __getattribute__
    return super().__getattribute__(attr)
AttributeError: 'ModalOperator' object has no attribute 'lmb'

But even if I change the script to get rid of the error like so
gizmo_operator_invoke_phi.blend

I am seeing the INVOKE for both cases ("S"+LEFTMOUSE as well as ALT+LEFTMOUSE)

Am I doing something wrong?

> use the combination "S"+LEFTMOUSE First of all, I am getting this ``` Error: Traceback (most recent call last): File "/gizmo_operator_invoke.blend/Text", line 53, in modal File "//scripts/modules/bpy_types.py", line 713, in __getattribute__ return super().__getattribute__(attr) AttributeError: 'ModalOperator' object has no attribute 'lmb' ``` But even if I change the script to get rid of the error like so [gizmo_operator_invoke_phi.blend](https://archive.blender.org/developer/F8638918/gizmo_operator_invoke_phi.blend) I am seeing the INVOKE for both cases ("S"+LEFTMOUSE as well as ALT+LEFTMOUSE) Am I doing something wrong?
Author
Member

Well that's strange.. This is what happening to me with a Blender in factory settings :

  • First, I I use ALT+LEFTMOUSE, you can see the invoke is called every times, I need to RIGHTCLICK multiple times to cancelled the modal.
  • Then I use S+LEFTMOUSE multiple times but you can see that the invoke is called only one time.

This is happening to me with the latest build of 2.9 too.

2020-06-23_18-19-25.gif

Thank you for taking the time @lichtwerk !

Well that's strange.. This is what happening to me with a Blender in factory settings : - First, I I use ALT+LEFTMOUSE, you can see the invoke is called every times, I need to RIGHTCLICK multiple times to cancelled the modal. - Then I use S+LEFTMOUSE multiple times but you can see that the invoke is called only one time. This is happening to me with the latest build of 2.9 too. ![2020-06-23_18-19-25.gif](https://archive.blender.org/developer/F8639280/2020-06-23_18-19-25.gif) Thank you for taking the time @lichtwerk !
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Sorry this has been lying around for so long!

Checked this again now, and I can reproduce (will update the report description a bit to make it more obvious)

Sorry this has been lying around for so long! Checked this again now, and I can reproduce (will update the report description a bit to make it more obvious)
Philipp Oeser changed title from Python - operator called by gizmo always called the invoke() from the combination ALT + LEFTMOUSE to Python - operator called by gizmo always called the invoke() from the combination ALT + LEFTMOUSE (also asserts) 2020-11-23 17:04:54 +01:00

Added subscriber: @ckohl_art

Added subscriber: @ckohl_art
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'
Member

I can't recreate this in current master, maybe I'm misunderstanding. Is this issues still happening?

I can't recreate this in current master, maybe I'm misunderstanding. Is this issues still happening?
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Member

In #77810#1105385, @JulianEisel wrote:
I can't recreate this in current master, maybe I'm misunderstanding. Is this issues still happening?

Yep, I am still getting the assert in a debug build

Note: in a Debug build, an Assert should be triggered when pressing {key Alt} and start clicking

> In #77810#1105385, @JulianEisel wrote: > I can't recreate this in current master, maybe I'm misunderstanding. Is this issues still happening? Yep, I am still getting the assert in a debug build > Note: in a Debug build, an Assert should be triggered when pressing {key Alt} and start clicking
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:24:24 +01:00
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
4 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#77810
No description provided.