context area/region are not updated during a modal loop #28969
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#28969
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%context.area and context.region don't seem to update accordingly to the mouse focus in the common case, but they will in less common cases, like switching to another screen during the modal execution, or by starting the modal from a fullscreened area then go back to normal. so it's more difficult and less reliable to know on which region is the mouse in the common case(workarounds but there's limitations). a testfile about this : http://www.pasteall.org/blend/9241.%%%
Changed status to: 'Open'
%%%This is a a feature of the operator system, operators have their callbacks executed in the context that they were started in. For typical modal operators like transform this is useful behavior, but I guess for your operator it's not. What is it that you're trying to do with this, maybe there is another solution?%%%
%%%What is it that you're trying to do with this
:) in the test case I used the modal template provided in blender 2.59 (the one that turns the mouse into a BGL pen) and modified it a bit to illustrate what I wrote. I didn't write odd things, (but it's true I usually like to write odd things in python) I used the modal in a 'normal' way and noticed the context area / context does not returns the same values depending on the cases above. wether it returns the attached area/region, or the mouseover area/region, it's beyond me, but it should not returns both.
I also have a concrete example of odd things I needed to do about modal at the link below. unfortunately it's not a 'sample/simple case' but a multi-module addon with lots of workarounds :
about #28970 (missing event),
real region location of the mouse pointer (UI or WINDOW)
callback_add() to out of context region ( else BGL is draw on the panel not in the window : http://blenderartists.org/forum/showthread.php?223152-Opengl-in-Blender-2.6&p=1972713&viewfull=1#post1972713)
...
https://github.com/littleneo/image_tools
oddest things are in modal.py (373-382) and and line 280 if init block
%%%
%%%Moved to todo list, the operator system simply was not designed to work this way, it would be useful to make it possible to track the context but it's not considered a bug.
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface#Undo.2C_Redo_and_Operator_Context%%%
Changed status from 'Open' to: 'Archived'