Modal Operator Breaks on Workspace Change #77419

Open
opened 2020-06-05 08:34:13 +02:00 by Wayde Moss · 10 comments
Member

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

Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: 211b6c29f7
Broken: 2.82.7
Broken: 2.81.16

Worked: 2.79b

Short description of error
Modal Operators appear to break when changing work spaces or fullscreening a window space.

Exact steps for others to reproduce the error
Open attached file
Run script (OperatorModalDraw.py)
In view3D run operator
Either change workspace or RClick the header to maximize the view3D.
Drawing broken and a console error is thrown persistently: "internal error: modal gizmo-map handler has invalid area". This message is only shown for 2.83.

bug_op_modal_fullscreen.mp4

Blend file: modal_op_fullscreen.blend
It's an empty scene. The script used is the template Operator Modal Draw with a few minor changes to allow events to pass through and to not end on L/RClick.

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.66 **Blender Version** Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: `211b6c29f7` Broken: 2.82.7 Broken: 2.81.16 Worked: 2.79b **Short description of error** Modal Operators appear to break when changing work spaces or fullscreening a window space. **Exact steps for others to reproduce the error** Open attached file Run script (OperatorModalDraw.py) In view3D run operator Either change workspace or RClick the header to maximize the view3D. Drawing broken and a console error is thrown persistently: "internal error: modal gizmo-map handler has invalid area". This message is only shown for 2.83. [bug_op_modal_fullscreen.mp4](https://archive.blender.org/developer/F8578338/bug_op_modal_fullscreen.mp4) Blend file: [modal_op_fullscreen.blend](https://archive.blender.org/developer/F8578325/modal_op_fullscreen.blend) It's an empty scene. The script used is the template Operator Modal Draw with a few minor changes to allow events to pass through and to not end on L/RClick.
Author
Member

Added subscriber: @wbmoss_dev

Added subscriber: @wbmoss_dev

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

I can confirm.
Theoretically the area should be the same.
And even if it were not, when returning to the previous layout, context.area should return to the previous state.

Besides, this is how it worked in blender 2.79.
So confirming as a bug.

I can confirm. Theoretically the area should be the same. And even if it were not, when returning to the previous layout, `context.area` should return to the previous state. Besides, this is how it worked in blender 2.79. So confirming as a bug.

Added subscriber: @ckohl_art

Added subscriber: @ckohl_art

Added subscriber: @RyanSouthall

Added subscriber: @RyanSouthall
Member

Added subscriber: @VilemDuha

Added subscriber: @VilemDuha
Member

Just few small notes , since I was also fighting this problem a lot -

  • regarding to the pythong Gotcha's docs it's not recommended to keep reference to 'any' blender data during modal operation, so this probably also includes context:
    https://docs.blender.org/api/current/info_gotcha.html
  • It's better to implement a function that searches the best fitting/similar area to move the operator there, and if it isn't found, then end the operator.

context.copy() can fail in case some addons add properties or functions to it (like the X Muscle as far as I remember)

Just few small notes , since I was also fighting this problem a lot - - regarding to the pythong Gotcha's docs it's not recommended to keep reference to 'any' blender data during modal operation, so this probably also includes context: https://docs.blender.org/api/current/info_gotcha.html - It's better to implement a function that searches the best fitting/similar area to move the operator there, and if it isn't found, then end the operator. context.copy() can fail in case some addons add properties or functions to it (like the X Muscle as far as I remember)
Contributor

Added subscriber: @p2or

Added subscriber: @p2or

Added subscriber: @DotBow

Added subscriber: @DotBow
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:24:26 +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
7 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#77419
No description provided.