Fix #110723: cant drop object name on object field/socket in node editor #110929
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110929
Loading…
Reference in New Issue
No description provided.
Delete Branch "lichtwerk/blender:110723"
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?
Reason was a difference in poll functions (dropbox poll function vs.
operator poll function).
So the dropbox was actually recognized as being active (see
dropbox_active
) but then when actually dropping, the correspondingoperator wasnt called (but instead another operator was).
In detail, the way
wm_handlers_do_intern
works, it checks alldropboxes poll function if one succeeds it calls the dropbox operator.
But if that operators poll function fails,
wm_handlers_do_intern
happily continues and "ends" the drop operations in a way we dont
actually get to the "real" dropbox & operator that was also recognized
as being active.
In the case of the report:
UI_OT_drop_name
is activeNODE_OT_add_object
(node_object_drop_poll
)succeeds though
NODE_OT_add_object
(node_add_object_poll
) fails(it checks
UI_but_active_drop_name
already)So in order to make this work, add the check for
UI_but_active_drop_name
to two dropbox pollfunctions (and remove from the operator polls).
Probably good for LTS as well.
The fix itself makes sense I think. But I wonder if it really makes sense to duplicate the poll functions for dropboxes and operators. When an dropbox just references an operator, theoretically we could just call the operator poll function right? Maybe I'm missing something?
Afaict, the dropbox poll functions get direct access to the
wmDrag
[which the operator poll doesnt]It's not great to have a dropbox poll include checks for other dropboxes. But I guess it makes sense in this corner case. Maybe we could invert the order of the dropboxes instead, so the button dropboxes have priority.
For now this seems fine, although I think we can remove the poll check from the operator?
I tried registering (
ED_dropboxes_ui
) the UI dropboxes after the space dropboxes (currently this is the other way around) but that didnt change the order they were called. The proper way to do that would be to delayed_default_handlers
to happen after the area and region init inED_area_init
(tried that, would actually work, yes).However, I dont think giving a whole whole group of dropboxes priority over another group is much cleaner, I think it is more flexible and transparent to be able define/check polls that could let you give prio to whatever dropbox you like.
No strong opinion here though, your call :)
Think so, too, updated the PR.
We have to figure out what order makes the most sense: UI dropboxes before space dropboxes or the other way around. Issues like this suggest the current order may be sub-optimal, and we should consider changing it. Dependencies between different dropboxes and such tend to get out of sync, so they are code/design smells.
Anyway, this is more of a correction to a previous fix, the order of dropbox handling priority can still be changed.
If in doubt, the UI dropboxes should probably have preference (so delay
ed_default_handlers
to happen after the area and region init inED_area_init
), I would assumethere is a reason why these are called "general" which implies these should work everywhere.Can put up another PR for this if you like (it is not the easiest task to reason this though -- as I said, there might be other cases where a region dropbox should have preference, wil aslo think about this more...)