Blender Git Loki

Git Commits -> Revision a1cc704

Revision a1cc704 by Lukas Toenne (master)
June 16, 2021, 17:35 (GMT)
Edge-scrolling for node editor

Starts scrolling when dragging a node or node link and going outside the current window.
Largely copied from the VIEW2D_OT_edge_pan operator.

Edge panning operator customdata and supporting functions now in
UI_view2d.h, so they could be used by operators in other editor
libraries. The VIEW2D_OT_edge_pan operator also uses this customdata and
shared functions now. Operators properties can be used to configure
edge panning margins and speed for each use case, rather than using
hardcoded values.

The speed function for edge panning has been tweaked somewhat:
* "Speed per pixel" has been replaced with a "speed ramp" distance.
This is more intuitive and also creates an upper bound for the speed,
which can otherwise become extreme with large cursor distance.
* "Max speed" is reached at the end of the speed ramp.
* Padding the region inside and outside is applied as before, but both
values are operator properties now.

Node transform operator also supports edge panning. This requires
an offset for changes in the view2d rect, otherwise nodes are "stuck"
to the original view.

Transform operator had cursor wrapping categorically enabled, but this
gets quite confusing with the edge scrolling mechanism. A new TransInfo
option T_NO_CURSOR_WRAP has been introduced to disable this behavior.
The double negative is a bit annoying, but want to avoid affecting the
existing transform modes, so by default it should still set the
OP_IS_MODAL_GRAB_CURSOR flag (which then sets the WM_CURSOR_WRAP_XY
flag during modal execution).

Reviewed By: HooglyBoogly, JacquesLucke

Differential Revision: https://developer.blender.org/D11073

Commit Details:

Full Hash: a1cc7042a745b4bfd882367cf4c4653467c1e430
Parent Commit: 247abdb
Lines Changed: +514, -163

1 Added Path:

/source/blender/editors/interface/view2d_edge_pan.c (+345, -0) (View)

10 Modified Paths:

/source/blender/editors/include/ED_node.h (+5, -0) (Diff)
/source/blender/editors/include/UI_view2d.h (+75, -0) (Diff)
/source/blender/editors/interface/CMakeLists.txt (+1, -0) (Diff)
/source/blender/editors/interface/view2d_ops.c (+11, -149) (Diff)
/source/blender/editors/space_node/node_intern.h (+4, -0) (Diff)
/source/blender/editors/space_node/node_relationships.cc (+11, -0) (Diff)
/source/blender/editors/space_outliner/outliner_dragdrop.c (+1, -1) (Diff)
/source/blender/editors/transform/transform.h (+3, -0) (Diff)
/source/blender/editors/transform/transform_convert_node.c (+55, -11) (Diff)
/source/blender/editors/transform/transform_ops.c (+3, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021