Maniphest T93606

drawing of (addon defined) gizmos, while a modal operator runs
Closed, Resolved

Assigned To
MACHIN3 (MACHIN3)
Authored By
MACHIN3 (MACHIN3)
Dec 3 2021, 6:01 PM
Tags
  • BF Blender
Subscribers
Campbell Barton (campbellbarton)
Germano Cavalcante (mano-wii)
MACHIN3 (MACHIN3)
zender (aschellekens1100)

Description

System Information
Operating system: Linux-4.15.0-159-generic-x86_64-with-glibc2.27 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.91.03

Blender Version
Broken: version: 3.0.0 Release Candidate, branch: master, commit date: 2021-11-25 17:24, hash: rB2fb8c6805a98
Worked: 2,93

Short description of error
In 2.93 Blender would stop drawing addon defined gizmos, while a modal operator is running.
in 3.0 however, gizmos will keep being drawn. The only exception are native gizmo's such as from the transform tool. Addon defined gizmos are treated like the navigation gizmos, and I assume it's related to rB917a972b56af10

See this video demo using a template script (blend file below).

If this is intentional behavior, then I'd like to know if there is a way to treat addon-defined gizmos like the native tool gizmos.

I find the gizmo hiding particularly useful for more complex groups, such as this one. For - I assume - the same reason native gizmo groups are hidden, I'd like to hide mine as well, while modal operators are running.

Exact steps for others to reproduce the error

  • open the attached blend file in 2.93 and in 3.0
  • run the script in the Scripting Workspace
    • a gizmos appears
  • call the bevel operator via shortcut
    • in 2.93 notice how all gizmos vanish: the navigation gizmos, the transform tool's gizmo group and also the script defined gizmo
    • in 3.0 only the transform tool's gizmo group is hidden.

Related Objects

Mentioned Here
rB7eaed14fae86: Fix T72948: Smooth active tool gizmo vibrates
rB917a972b56af: UI: keep navigation gizmos visible during modal operators

Event Timeline

MACHIN3 (MACHIN3) created this task.Dec 3 2021, 6:01 PM
MACHIN3 (MACHIN3) updated the task description.Dec 3 2021, 6:03 PM
MACHIN3 (MACHIN3) updated the task description.Dec 3 2021, 6:25 PM
MACHIN3 (MACHIN3) updated the task description.
MACHIN3 (MACHIN3) added a subscriber: Campbell Barton (campbellbarton).Dec 3 2021, 6:30 PM

Ì'd appreciate it if you could take a look at this @Campbell Barton (campbellbarton). Thank you!

zender (aschellekens1100) added a subscriber: zender (aschellekens1100).EditedDec 4 2021, 1:38 PM

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1650/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.47

Blender Version
Broken: version: 3.0.0 Beta, branch: master, commit date: 2021-11-18 12:24, hash: rBbd2e3bb7bd06
Worked: (newest version of Blender that worked as expected)

Short description of error
[Please fill out a short description of the error here]

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]

I can reproduce only when I use hotkeys. Dragging the gizmo seems to work properly.

EDIT:
Also reproduced on the latest stable 3.0, identical results

Germano Cavalcante (mano-wii) closed this task as Archived.Dec 8 2021, 9:57 PM
Germano Cavalcante (mano-wii) added a subscriber: Germano Cavalcante (mano-wii).

Thanks for the report, but some of the gizmos that are hidden during a modal operation have a pool that checks the value of G.moving.
Unfortunately this value is not exposed in python so I'm not sure there's a convenient way to simulate the same behavior of these tools in python.
(Note: not all "native tool gizmos" have this behavior).

The fact that G.moving is not exposed in python is not a bug.
So closing as this bug tracker is only for bugs and errors.

For user requests and feedback, you can try other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

MACHIN3 (MACHIN3) added a comment.EditedDec 9 2021, 7:38 AM

@Germano Cavalcante (mano-wii) There are other - probably related behaviour - changes too. For instance I can't even manually adjust gizmo.use_modal_draw in a modal op, which worked perfectly before, but doesn't anymore. I assumed it is related to this issue here.

some of the gizmos that are hidden during a modal operation have a pool that checks the value of G.moving

Was this pool newly introduced for 3.0?

Germano Cavalcante (mano-wii) added a comment.Dec 9 2021, 7:55 AM
In T93606#1268807, @MACHIN3 (MACHIN3) wrote:

Was this pool newly introduced for 3.0?

it's not new.
https://docs.blender.org/api/current/bpy.types.GizmoGroup.html#bpy.types.GizmoGroup.poll

MACHIN3 (MACHIN3) added a comment.EditedDec 9 2021, 8:20 AM

When you said pool instead of poll, it sounded like the introduction of it is the cause for this.
If the poll checking for G.moving is not new, than why did the behavior change in 3.0?

As this is such a significant change in gizmo behavior, arguably for the worse, and one where the 2.93 behavior can no longer be recreated with script defined gizmos in 3.0, while native gizmo behave like before, can @Campbell Barton (campbellbarton) perhaps comment on this?

I feel like this was closed unreasonably, and it could be argued it is a bug (maybe not in code, but definitely in design), as 3.0 behavior is worse now without a way to fix it.

Germano Cavalcante (mano-wii) reopened this task as Needs Triage.Dec 9 2021, 2:47 PM

I understand this sounds like a bug, but gizmos made in C are no different from those made in python (except for the advantage of having access to more options).

Note that only some gizmos in the 3D view check G.moving. The gizmo for the measure tool does not check this for example.

Since to solve this we might need to expose the G.moving in python or create a new flag, or something else whose design needs to be discussed, this becomes more of a feature improvement than a bug fix. And the bug tracker site does not seem the most appropriate channel for this.

Other channels are suitable for requests: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

You can contact the developer directly on https://blender.chat/channel/blender-coders for example.


In T93606#1268822, @MACHIN3 (MACHIN3) wrote:

If the poll checking for G.moving is not new, than why did the behavior change in 3.0?

The G.moving check isn't new, it just wasn't evident before as all the gizmos (including the navigation ones) were hidden.
rB7eaed14fae86: Fix T72948: Smooth active tool gizmo vibrates


I'm reopening the report for someone else to triage (Although not a good practice as the list of reports is currently high).

MACHIN3 (MACHIN3) added a comment.Dec 9 2021, 2:51 PM

Thank you, I appreciate that.

MACHIN3 (MACHIN3) closed this task as Resolved.EditedDec 26 2021, 10:26 AM
MACHIN3 (MACHIN3) claimed this task.

Closing, as I've realized I can just do the G.moving check (or something similar) myself.
In fact you can check if any of the group's gizmos is_modal prop is True to determine how to draw (or hide gizmos) in draw_prepare() while the operator runs.

Of note is maybe that 3.0 seems to run refresh() even while a modal operator is running, which 2.93 didn't do. So if you are recreating your gizmos in that function, perhaps to adapt to various scene changes, you need to skip that refresh while is_modal is True for any of the gizmos. Easy enough. Everything working exactly as I want it now.

Thanks again @Germano Cavalcante (mano-wii)!