From 050428049f1f10ac2c8b6ccf7d775c6d9dcfe2ba Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Mon, 27 Feb 2012 17:38:16 +0000 Subject: 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. The default key is ALT+DKEY though, instead ALT+GKEY, since the latter is already used for the ungroup operator. --- source/blender/gpu/intern/gpu_codegen.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'source/blender/gpu/intern/gpu_codegen.c') diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 203fd00538f..bc77d15f76b 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1254,31 +1254,6 @@ int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNode return 1; } -int GPU_stack_link_mute(GPUMaterial *mat, const char *name, LinkInOutsMuteNode *mlnk) -{ - GPUNode *node; - GPUFunction *function; - int i; - - function = GPU_lookup_function(name); - if(!function) { - fprintf(stderr, "GPU failed to find function %s\n", name); - return 0; - } - - for(i = 0; i < mlnk->num_outs; i++) { - node = GPU_node_begin(name); - gpu_node_input_socket(node, (GPUNodeStack*)mlnk->in); - GPU_node_output(node, ((GPUNodeStack*)mlnk->outs+i)->type, ((GPUNodeStack*)mlnk->outs+i)->name, - &((GPUNodeStack*)mlnk->outs+i)->link); - GPU_node_end(node); - - gpu_material_add_node(mat, node); - } - - return 1; -} - int GPU_link_changed(GPUNodeLink *link) { GPUNode *node; -- cgit v1.2.3