Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-10-25 20:49:06 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-10-25 20:49:06 +0400
commit09ed97afc5b20767a67d598fa3ede70892b5d647 (patch)
treea15cd34777f011f0c43ed8c2cede6d28a80e0554 /source/blender/editors/space_node
parent7107b8eef843a19cabeab1e3d2e68cb3c1cba345 (diff)
Internal node links are now cached in a per-node list, instead of being generated as a transient list that is returned from the callback and had to be freed by the caller. These internal links are used for muted nodes, disconnect operators and reroute nodes, to effectively replace the node with direct input-to-output links.
Storing this list in the node has the advantage of requiring far fewer calls to the potentially expensive internal_connect callback. This was called on every node redraw ... Also it will allow Cycles to properly use the internal links for muted nodes, which ensures consistent behavior. The previous method was not applicable in Cycles because transient list return values are not supported well in the RNA and particularly the C++ API implementation.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/node_draw.c11
-rw-r--r--source/blender/editors/space_node/node_edit.c2
2 files changed, 2 insertions, 11 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 20afbf7ce65..05dcd55270b 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -506,25 +506,16 @@ int node_get_colorid(bNode *node)
/* note: in node_edit.c is similar code, for untangle node */
static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node)
{
- ListBase links;
bNodeLink *link;
- if (node->typeinfo->internal_connect == NULL)
- return;
-
- /* Get default muting links. */
- links = node->typeinfo->internal_connect(snode->edittree, node);
-
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
- for (link = links.first; link; link = link->next)
+ for (link = node->internal_links.first; link; link = link->next)
node_draw_link_bezier(v2d, snode, link, TH_REDALERT, 0, TH_WIRE, 0, TH_WIRE);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
-
- BLI_freelistN(&links);
}
/* this might have some more generic use */
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 3635c1d0f03..f21f343ea2b 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -1622,7 +1622,7 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op))
for (node = snode->edittree->nodes.first; node; node = node->next) {
/* Only allow muting of nodes having a mute func! */
- if ((node->flag & SELECT) && node->typeinfo->internal_connect) {
+ if ((node->flag & SELECT) && node->typeinfo->update_internal_links) {
node->flag ^= NODE_MUTED;
snode_update(snode, node);
}