Page MenuHome

Compositor nodes-rerouting
Closed, ResolvedPublicPATCH


===== Proposal =====

This proposal is a UI enhancement on the node editor to allow better workflow with large node systems.

==== Noodle line ====

By using MouseClick-SHIFT on a noodle a point will appear. The user can positioned this point (Reroute point).
This point can attach noodles at North, South, East, West
An arrow will be drawn on noodles between two reroute points
If noodles reach a certain length, an arrow will be drawn. This way users can see the direction of the line.
Every point can have multiple outputs. Eg you can add multiple points this way if you can connect the Combined socket of the renderlayer to other nodes in a structured way.

Current patch is limited to the compositor node tree.

===== Impact =====

==== DNA ====

There is a new NODE_FLAG and SOCK_FLAG called NODE_REROUTE and SOCK_REROUTE. telling the UI that it need to draw differently.

==== UI ====
The point is a special node, "RerouteNode". All nodetree will have one. it will be in a new submenu named "Helper" in the add node menu. This sub-menu will not be visible on screen.

=== Operators ===

a new operation will be added where the user can click on a line holding a certain key and this will add a RoutingNode in that position.

=== drawnode.c ===

For the RoutingNode a new function is introduced to draw the node.
When drawing bNodeLink that is connected to a routingnode a different algorithm will be used for drawing the bezier.

If the distance traveled on the x-axis is longer than the y-axis the link will be connected to the east or west of the node. If the y-axis is longer it will be the north of south.

When it is connected to the north of source, the bezier will be adjusted to draw it correctly.

When a line will be between two reroute nodes, an arrow will be draw on the line. This way the user know where the line is heading to.

==== nodes/???_ ====

All node types will get a RerouteNode. currently only the compositor will get one.
A rerouting node contains one input socket and one output socket and uses pass buffer to pass the data to the next node

Event Timeline

Updated the patch to svn trunk (r40828) be compatible with the changes to nodes introduced in 2.59. New patch is in patch-reroutenoodles_2.txt.

Reroute nodes now have their own custom drawing and draw preparation (drawupdate) functions. This makes them a lot simpler and helps avoid cluttering default draw functions (node_update_basis/node_draw_basis) with type-specific code.

thanks for the patch, can you update to a current version?

I've updated the patch to latest trunk (r44879) and made some improvements to simplify the code and make it more generic.

* Reroute nodes are now available in all tree types (previously only in compositor).

* Instead of actual execution functions (which adds overhead), the reroute nodes are treated as proxies and removed before the actual execution in the localization phase. Like muted nodes they have a simple internal relink function (just connect the single input to output) and can be bypassed the same way.

* The additional NODE_REROUTE and SOCK_REROUTE flags have been removed, these are not necessary and just add extra cases to check for. To avoid problems with auto-hidden sockets i've added another callback auto_hide_sockets to node types, which can be used to customize the way sockets are hidden when a node is collapsed (reroute node just ignores this). This can also be used in the future to make more usable auto-hiding feature, so nodes don't have to be un-collapsed every time to change links.

* Draw functions for the reroute node have been cleaned up. Only the node socket is now draw for them, not the node body. The (invisible) size of the node has been increased to make grabbing with RMB easier (still could need some tweaking).

After test by and discussion with Sebastian, i implemented two more features:

* The selection and tweak areas in nodes can now be customized by callback functions (default implementation uses the node->totr rect as before). The reroute node is very small (not much larger than the default tweak threshold), so it defines a bigger tweak area for comfortable grabbing with RMB.

* Nodes can be removed automatically now by setting the NODE_REMOVE flag. This allows a node to safely trigger its own deletion. The actual removal happens in ntreeUpdateTree after all node updates are done. The reroute node uses this so it gets removed when completely unlinked (there is no additional info in this node beside connections, this keeps things tidy)

Has been committed to trunk

Jeroen Bakker (jbakker) changed the task status from Unknown Status to Resolved.Jun 5 2012, 3:29 PM