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/blenkernel/BKE_node.h
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/blenkernel/BKE_node.h')
-rw-r--r--source/blender/blenkernel/BKE_node.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index d4b2755495e..cd1875f848b 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -193,10 +193,8 @@ typedef struct bNodeType {
struct bNodeTree *(*group_edit_set)(struct bNode *node, int edit);
void (*group_edit_clear)(struct bNode *node);
- /* Generate a temporary list of internal links (bNodeLink), for muting and disconnect operators.
- * Result must be freed by caller!
- */
- ListBase (*internal_connect)(struct bNodeTree *, struct bNode *node);
+ /* Update the internal links list, for muting and disconnect operators. */
+ void (*update_internal_links)(struct bNodeTree *, struct bNode *node);
/* **** execution callbacks **** */
void *(*initexecfunc)(struct bNode *node);
@@ -293,7 +291,7 @@ typedef struct bNodeTreeType {
int (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
/* Default internal linking. */
- ListBase (*internal_connect)(struct bNodeTree *, struct bNode *node);
+ void (*update_internal_links)(struct bNodeTree *, struct bNode *node);
} bNodeTreeType;
/* ************** GENERIC API, TREES *************** */
@@ -389,6 +387,7 @@ struct bNode *nodeGetActiveTexture(struct bNodeTree *ntree);
void nodeUpdate(struct bNodeTree *ntree, struct bNode *node);
int nodeUpdateID(struct bNodeTree *ntree, struct ID *id);
+void nodeUpdateInternalLinks(struct bNodeTree *ntree, struct bNode *node);
void nodeFreePreview(struct bNode *node);
@@ -445,7 +444,7 @@ void node_type_exec_new(struct bNodeType *ntype,
void (*freeexecfunc)(struct bNode *node, void *nodedata),
void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata,
struct bNodeStack **, struct bNodeStack **));
-void node_type_internal_connect(struct bNodeType *ntype, ListBase (*internal_connect)(struct bNodeTree *, struct bNode *));
+void node_type_internal_links(struct bNodeType *ntype, void (*update_internal_links)(struct bNodeTree *, struct bNode *));
void node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node,
struct GPUNodeStack *in, struct GPUNodeStack *out));
void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node,