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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-04-20 21:25:22 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-04-24 13:44:27 +0300
commitd730e512ac56bd68c75f8c44ff186b51010db4c7 (patch)
treedddf69daf78ac1627db7069ef3012b8ecb54017f /source/blender/blenkernel/BKE_node.h
parent62421470ee09fb70f343eb9fd48b093316c8eea1 (diff)
Nodes: avoid slow and unecessary node group updates on file read
On file read we need to update group nodes in case the group they refer to has changed its inputs and outputs. This had O(n^2) time complexity and was updating all datablocks even if they did not change.
Diffstat (limited to 'source/blender/blenkernel/BKE_node.h')
-rw-r--r--source/blender/blenkernel/BKE_node.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 682d0b981fa..70b4903e746 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -218,7 +218,7 @@ typedef struct bNodeType {
/// Called when the node is updated in the editor.
void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node);
/// Check and update if internal ID data has changed.
- void (*verifyfunc)(struct bNodeTree *ntree, struct bNode *node, struct ID *id);
+ void (*group_update_func)(struct bNodeTree *ntree, struct bNode *node);
/// Initialize a new node instance of this type after creation.
void (*initfunc)(struct bNodeTree *ntree, struct bNode *node);
@@ -395,10 +395,8 @@ struct bNode *ntreeFindType(const struct bNodeTree *ntree, int type);
bool ntreeHasType(const struct bNodeTree *ntree, int type);
bool ntreeHasTree(const struct bNodeTree *ntree, const struct bNodeTree *lookup);
void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree);
-/* XXX Currently each tree update call does call to ntreeVerifyNodes too.
- * Some day this should be replaced by a decent depsgraph automatism!
- */
-void ntreeVerifyNodes(struct Main *main, struct ID *id);
+void ntreeUpdateAllNew(struct Main *main);
+void ntreeUpdateAllUsers(struct Main *main, struct ID *id);
void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, int *totnodes);
@@ -736,10 +734,10 @@ void node_type_label(
struct bNodeType *ntype,
void (*labelfunc)(struct bNodeTree *ntree, struct bNode *, char *label, int maxlen));
void node_type_update(struct bNodeType *ntype,
- void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node),
- void (*verifyfunc)(struct bNodeTree *ntree,
- struct bNode *node,
- struct ID *id));
+ void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node));
+void node_type_group_update(struct bNodeType *ntype,
+ void (*group_update_func)(struct bNodeTree *ntree,
+ struct bNode *node));
void node_type_exec(struct bNodeType *ntype,
NodeInitExecFunction initexecfunc,