Page MenuHome

Fix T94415: Nodes: poor selection behavior inside frame nodes
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Jan 5 2022, 1:12 PM.
Tokens
"Love" token, awarded by hitrpr."Love" token, awarded by Aeraglyx."Love" token, awarded by lukastoenne."Love" token, awarded by lone_noel."Love" token, awarded by jc4d."100" token, awarded by charlie."Love" token, awarded by rawalanche.

Details

Summary

Previously, node selection made no distinction between a frame node and
other nodes. So a frame node would be selected by their whole rect or
center (depending on box/lasso/circle select). As a consequence of this,
box and lasso could not practically be started inside a frame node (with
the intention to select a subset of contained child nodes) because the
frame would be selected immediately and tweak-transforming started.
Circle selecting would always contain the frame node as well (making
transforming a subset of nodes without also transforming the whole frame
impossible).

Now change selection behavior so that for all selection modes only the
border [the margin area that is automatically added around all nodes,
see note below] of a frame node is considered in selection. This makes
for a much more intuitive experience when arranging nodes inside frames.

note: to make the area of interest for selection/moving more obvious,
the cursor changes when hovering over (as is done for resizing).
(this is not shown in the video since this was made from an older version of the patch)
note: this also makes the resize margin consistent with other nodes.
note: this also fixes right resize border (was exclusive instead of
inclusive as every other border)

Also fixes T46540.

Diff Detail

Repository
rB Blender

Event Timeline

While I like the new behavior overall, I don't like that it becomes very non-obvious how to move a frame. That could be improved by changing the mouse cursor when hovering over the dragging area of a frame (as is done for resizing). Not sure if we do something similar in other places when something can be moved.

source/blender/editors/space_node/node_select.cc
105

Think it's not necessary to set every element separately.

843

I don't think it's necessarily counter-intuitive. The issue is really just that box selection doesn't work.

Pinging @Erindale (Erindale) just to make sure this is actually what people want/expect. Is there anything that could be improved here @Erindale (Erindale)?

While I like the new behavior overall, I don't like that it becomes very non-obvious how to move a frame. That could be improved by changing the mouse cursor when hovering over the dragging area of a frame (as is done for resizing). Not sure if we do something similar in other places when something can be moved.

Hard to tell (if you already know that it can be moved by click-dragging the border), thought it was pretty obvious, will try the cursor thingie though and see how that feels

Philipp Oeser (lichtwerk) edited the summary of this revision. (Show Details)
  • make box selection use the same behavior
  • add transform cursor hovering over the border area
Jacques Lucke (JacquesLucke) requested changes to this revision.Jan 31 2022, 12:29 PM

The behavior is so much better already! Resizing the frame is a bit weird now.

source/blender/editors/space_node/node_draw.cc
2271 ↗(On Diff #47694)

That's only true when the "Shrink" property of the frame node is checked.
Currently it is a bit weird, because it shows the move cursor when hovering exactly on the frame border, but starts resizing when dragging.

This revision now requires changes to proceed.Jan 31 2022, 12:29 PM
Philipp Oeser (lichtwerk) edited the summary of this revision. (Show Details)
  • fix resize cursor not showing for non "auto-shrinking" frame nodes
  • make the resize margin consistent with other nodes.
  • small fix for right resize border (was exclusive instead of inclusive as every other border)
Philipp Oeser (lichtwerk) marked 2 inline comments as done.Feb 1 2022, 4:40 PM
This comment was removed by Philipp Oeser (lichtwerk).

Other than a couple inline comments, this looks good to me.

source/blender/editors/space_node/node_intern.hh
122 ↗(On Diff #47765)

New functions can use const and a reference, since the node is expected not to be null: const bNode &node

source/blender/editors/space_node/node_select.cc
850–851

I'm not sure this comment is exactly right. The behavior I observe without this patch is that circle select just also selected the frame node in the background, not that it prevents selecting nodes in the foreground.

This revision is now accepted and ready to land.Feb 7 2022, 11:25 PM