Blender Git Commit Log

Git Commits -> Revision 7f759ec

Revision 7f759ec by Lukas Toenne (master)
December 3, 2015, 12:04 (GMT)
Node callback for handling link insertion and swapping of occupied inputs.

Nodes have a feature for moving existing links to unoccupied sockets when connecting
to an already used input. This is based on the standard legacy socket types (value/float,
vector, color/rgba) and works reasonably well for shader, compositor and texture nodes.

For new pynode systems, however, the hardcoded nature of that feature has major drawbacks:
* It does not take different type systems into account, leading to meaningless connections
when sockets are swapped and making the feature useless or outright debilitating.
* Advanced socket behaviors would be possible with a registerable callback, e.g. creating
extensible input lists that move existing connections down to make room for a new link.

Now any handling of new links is done via the 'insert_links' callback, which can also be
registered through the RNA API. For the legacy shader/compo/tex nodes the behavior is the
same, using a C callback.

Note on the 'use_swap' flag: this has been removed because it was meaningless anyway:
It was disabled only for the insert-node-on-link feature, which works only for
completely unconnected nodes anyway, so there would be nothing to swap in the first place.

Commit Details:

Full Hash: 7f759ec547a563284f29f7a80b96316854b37ae5
Parent Commit: 762aad3
Lines Changed: +150, -79

11 Modified Paths:

/source/blender/blenkernel/BKE_node.h (+2, -0) (Diff)
/source/blender/editors/space_node/node_relationships.c (+17, -73) (Diff)
/source/blender/makesrna/intern/rna_nodetree.c (+32, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_common.c (+1, -0) (Diff)
/source/blender/nodes/composite/node_composite_util.c (+1, -0) (Diff)
/source/blender/nodes/intern/node_util.c (+90, -0) (Diff)
/source/blender/nodes/intern/node_util.h (+3, -0) (Diff)
/source/blender/nodes/shader/nodes/node_shader_common.c (+1, -0) (Diff)
/source/blender/nodes/shader/node_shader_util.c (+1, -0) (Diff)
/source/blender/nodes/texture/nodes/node_texture_common.c (+1, -0) (Diff)
/source/blender/nodes/texture/node_texture_util.c (+1, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021