drawing of (addon defined) gizmos, while a modal operator runs #93606

Closed
opened 2021-12-03 18:01:15 +01:00 by MACHIN3 · 16 comments

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: 2fb8c6805a
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 917a972b56

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.

gizmo_drawing_while_modal_operator_runs.blend

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.
**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: `2fb8c6805a` 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 917a972b56 See this [video demo ](https://youtu.be/2Us-Z_SHv7M) 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 ](https://youtu.be/ovLziBivvNM), 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. [gizmo_drawing_while_modal_operator_runs.blend](https://archive.blender.org/developer/F12687167/gizmo_drawing_while_modal_operator_runs.blend) **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.
Author

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3
Author

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Author

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

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

Added subscriber: @aschellekens09

Added subscriber: @aschellekens09

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: bd2e3bb7bd
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.

ezgif-2-a9c95993a874.gif

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

**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: `bd2e3bb7bd` 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. ![ezgif-2-a9c95993a874.gif](https://archive.blender.org/developer/F12689033/ezgif-2-a9c95993a874.gif) EDIT: Also reproduced on the latest stable 3.0, identical results

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

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

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
Author

@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?

@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?

In #93606#1268807, @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

> In #93606#1268807, @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
Author

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 @ideasman42 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.

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 @ideasman42 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.

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

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

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 #93606#1268822, @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.
7eaed14fae


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

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 #93606#1268822, @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. 7eaed14fae --- I'm reopening the report for someone else to triage (Although not a good practice as the list of reports is currently high).
Author

Thank you, I appreciate that.

Thank you, I appreciate that.
Author

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

Changed status from 'Needs Triage' to: 'Resolved'
MACHIN3 self-assigned this 2021-12-26 10:26:05 +01:00
Author

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 @mano-wii!

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 @mano-wii!
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
3 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#93606
No description provided.