Page MenuHome

Fix problem with Viewport Manipulator Gizmo
Closed, ResolvedPublic

Description

As the Drawing/Sculpt/Weight mode capture any mouse input, the manipulator cannot be used.

Now, as the Draw operator is enabled when press LMB, the event of the operator is captured before gizmo.

We need

a) handle before gizmo events
or
b) a function to detect the cursor is over gizmo, something like ED_is_over_gizmo()

Details

Type
Bug

Event Timeline

Bastien Montagne (mont29) triaged this task as Normal priority.Jul 20 2018, 2:34 PM
Antonio Vazquez (antoniov) renamed this task from Fix problem with Viewport Manipulator to Fix problem with Viewport Manipulator Gizmo.

@Campbell Barton (campbellbarton) Could you take a look on this problem.

Now, as the Draw operator is enabled when press LMB, the event of the operator is captured before gizmo.

We need a) handle before gizmo events or b) a function to detect the cursor is over gizmo, something like ED_is_over_gizmo()

Checking if an event is over a manipulator isn't cheap.

Also, by design, its not good to have to search to find if an event would be handled.
(manipulators might be under the cursor but de-activated too... - pass-through for eg).

So think it's best to find why this works for sculpt mode-mode, vertex-paint, curve-draw - all work correctly, but not grease pencil.

@Campbell Barton (campbellbarton) Following your advices, I looked at the GPENCIL_OT_draw operator and what were the differences with sculpt paint. I have seen that both operators are very similar (I guess the initial implementation was a duplication of sculpt operator and modified). Both operators keymaps definition are very similar and I do not find apparent differences.

I have been doing debug and I have found the Invoke function of SCULPT_OT_brush_stroke operator is only called when the mouse is pressed in the viewport, but if you press over the gizmo, the invoke function is not called, so I assume the operator is not started.

I have checked the keymap and operator poll of sculpt operator and both return true over the gizmo, so there is something that does that events of gizmo are captured before than sculpt.

I looked in keymap registration too, but I'm unable to find where it's the place to set the gizmo capture events before sculpt operators to do the same for grease pencil operators.

Could you help me?

@Joshua Leung (aligorith) Do you have any idea?