[Bf-codereview] Simplification of node muting and new detach operator (issue 5695063)

lukas.toenne at googlemail.com lukas.toenne at googlemail.com
Sat Feb 25 16:08:17 CET 2012


Reviewers: bf-codereview_blender.org,

Description:
Implements a new operator for detaching nodes. In the process i
overhauled the node muting system as well.

There are a number of features that use a kind of "internal linking" in
nodes:
1. muting
2. delete + reconnect (restore link to/from node after delete)
3. the new detach operator (same as 2, but don't delete the node)

The desired behavior in all cases is the same: find a sensible mapping
of inputs-to-outputs of a node. In the case of muting these links are
displayed in red on the node itself. For the other operators they are
used to relink connections, such that one gets the best possible ongoing
link between previous up- and downstream nodes.

Muting previously used a complicated callback system to ensure
consistent behavior in the editor as well as execution in compositor,
shader cpu/gpu and texture nodes. This has been greatly simplified by
moving the muting step into the node tree localization functions. Any
muted node is now bypassed using the generalized nodeInternalRelink
function and then removed from the local tree. This way the internal
execution system doesn't have to deal with muted nodes at all, as if
they are non-existent.

The same function is also used by the delete_reconnect and the new
links_detach operators (which work directly in the editor node tree).
Detaching nodes is currently keymapped as a translation variant (macro
operator): pressing ALTKEY + moving node first detaches and then
continues with regular transform operator.

Please review this at http://codereview.appspot.com/5695063/

Affected files:
   source/blender/blenkernel/BKE_node.h
   source/blender/blenkernel/intern/node.c
   source/blender/editors/space_node/node_draw.c
   source/blender/editors/space_node/node_edit.c
   source/blender/editors/space_node/node_intern.h
   source/blender/editors/space_node/node_ops.c
   source/blender/editors/transform/transform_ops.c
   source/blender/gpu/GPU_material.h
   source/blender/gpu/intern/gpu_codegen.c
   source/blender/makesdna/DNA_node_types.h
   source/blender/nodes/composite/node_composite_tree.c
   source/blender/nodes/composite/node_composite_util.c
   source/blender/nodes/composite/node_composite_util.h
   source/blender/nodes/composite/nodes/node_composite_composite.c
   source/blender/nodes/composite/nodes/node_composite_outputFile.c
   source/blender/nodes/composite/nodes/node_composite_splitViewer.c
   source/blender/nodes/composite/nodes/node_composite_viewer.c
   source/blender/nodes/intern/node_exec.c
   source/blender/nodes/intern/node_util.c
   source/blender/nodes/intern/node_util.h
   source/blender/nodes/shader/node_shader_tree.c
   source/blender/nodes/shader/node_shader_util.c
   source/blender/nodes/shader/node_shader_util.h
   source/blender/nodes/shader/nodes/node_shader_output.c
   source/blender/nodes/shader/nodes/node_shader_output_lamp.c
   source/blender/nodes/shader/nodes/node_shader_output_material.c
   source/blender/nodes/shader/nodes/node_shader_output_world.c
   source/blender/nodes/texture/node_texture_tree.c
   source/blender/nodes/texture/node_texture_util.c
   source/blender/nodes/texture/node_texture_util.h
   source/blender/nodes/texture/nodes/node_texture_output.c
   source/blender/nodes/texture/nodes/node_texture_viewer.c




More information about the Bf-codereview mailing list