Geometry Nodes: remove some unnecessary updates

This fixes a few "obvious" places where we do unnecessary updates.
Those special cases were added in the early days of geometry nodes
when many updates were missing and we tried to get it to work at all.
There is a fairly high risk that with this change some required updates
will be missing again. Those can be fixed when we find thme.
Some of the update issues might have been fixed by rB58818cba40794905f9323080e60884e090f2d388
and similar changes we added over time.

Differential Revision: https://developer.blender.org/D11238
This commit is contained in:
Jacques Lucke 2021-05-14 10:58:08 +02:00
parent 9797b95f61
commit 26b4ef6823
Notes: blender-bot 2023-02-14 09:29:42 +01:00
Referenced by issue #88298, Geometry Nodes - Attribute Sample Texture Node does not update ( possibly after the input change )
Referenced by issue #88198, Geometry Nodes is re-evaluated even when nothing changed in the main tree
3 changed files with 1 additions and 11 deletions

View File

@ -4327,7 +4327,7 @@ void ntreeUpdateAllUsers(Main *main, ID *id)
if (GS(id->name) == ID_NT) {
bNodeTree *ngroup = (bNodeTree *)id;
if (ngroup->type == NTREE_GEOMETRY) {
if (ngroup->type == NTREE_GEOMETRY && (ngroup->update & NTREE_UPDATE_GROUP)) {
LISTBASE_FOREACH (Object *, object, &main->objects) {
LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
if (md->type == eModifierType_Nodes) {

View File

@ -1713,8 +1713,6 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op))
}
}
do_tag_update |= ED_node_is_geometry(snode);
snode_notify(C, snode);
if (do_tag_update) {
snode_dag_update(C, snode);
@ -1755,8 +1753,6 @@ static int node_delete_exec(bContext *C, wmOperator *UNUSED(op))
}
}
do_tag_update |= ED_node_is_geometry(snode);
ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);

View File

@ -852,8 +852,6 @@ static void node_link_exit(bContext *C, wmOperator *op, bool apply_links)
}
ntree->is_updating = false;
do_tag_update |= ED_node_is_geometry(snode);
ntreeUpdateTree(bmain, ntree);
snode_notify(C, snode);
if (do_tag_update) {
@ -1291,8 +1289,6 @@ static int cut_links_exec(bContext *C, wmOperator *op)
}
}
do_tag_update |= ED_node_is_geometry(snode);
if (found) {
ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);
@ -1399,8 +1395,6 @@ static int mute_links_exec(bContext *C, wmOperator *op)
link->flag &= ~NODE_LINK_TEST;
}
do_tag_update |= ED_node_is_geometry(snode);
ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);
if (do_tag_update) {