Nodes: fix incorrectly parameter name and type

The parameter type was incorrectly changed in rB6be56c13e96048cbc494ba5473a8deaf2cf5a6f8 by me.
This can be any id and does not have to be a node tree.
This commit is contained in:
Jacques Lucke 2020-12-10 16:12:11 +01:00
parent 1d447dcd19
commit 3d25312617
Notes: blender-bot 2023-02-14 11:00:17 +01:00
Referenced by issue #83592, Crash on linked scene reload while this scene is active
3 changed files with 16 additions and 13 deletions

View File

@ -451,7 +451,7 @@ 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);
void ntreeUpdateAllNew(struct Main *main);
void ntreeUpdateAllUsers(struct Main *main, struct bNodeTree *ngroup);
void ntreeUpdateAllUsers(struct Main *main, struct ID *id);
void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, int *totnodes);

View File

@ -342,7 +342,7 @@ static void libblock_remap_data_postprocess_obdata_relink(Main *bmain, Object *o
static void libblock_remap_data_postprocess_nodetree_update(Main *bmain, ID *new_id)
{
/* Update all group nodes using a node group. */
ntreeUpdateAllUsers(bmain, (bNodeTree *)new_id);
ntreeUpdateAllUsers(bmain, new_id);
}
/**

View File

@ -3960,9 +3960,9 @@ void ntreeUpdateAllNew(Main *main)
FOREACH_NODETREE_END;
}
void ntreeUpdateAllUsers(Main *main, bNodeTree *ngroup)
void ntreeUpdateAllUsers(Main *main, ID *id)
{
if (ngroup == NULL) {
if (id == NULL) {
return;
}
@ -3971,7 +3971,7 @@ void ntreeUpdateAllUsers(Main *main, bNodeTree *ngroup)
bool need_update = false;
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
if (node->id == &ngroup->id) {
if (node->id == id) {
if (node->typeinfo->group_update_func) {
node->typeinfo->group_update_func(ntree, node);
}
@ -3986,13 +3986,16 @@ void ntreeUpdateAllUsers(Main *main, bNodeTree *ngroup)
}
FOREACH_NODETREE_END;
if (ngroup->type == NTREE_GEOMETRY) {
LISTBASE_FOREACH (Object *, object, &main->objects) {
LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
if (md->type == eModifierType_Nodes) {
NodesModifierData *nmd = (NodesModifierData *)md;
if (nmd->node_group == ngroup) {
MOD_nodes_update_interface(object, nmd);
if (GS(id->name) == ID_NT) {
bNodeTree *ngroup = (bNodeTree *)id;
if (ngroup->type == NTREE_GEOMETRY) {
LISTBASE_FOREACH (Object *, object, &main->objects) {
LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
if (md->type == eModifierType_Nodes) {
NodesModifierData *nmd = (NodesModifierData *)md;
if (nmd->node_group == ngroup) {
MOD_nodes_update_interface(object, nmd);
}
}
}
}
@ -4041,7 +4044,7 @@ void ntreeUpdateTree(Main *bmain, bNodeTree *ntree)
}
if (bmain) {
ntreeUpdateAllUsers(bmain, ntree);
ntreeUpdateAllUsers(bmain, &ntree->id);
}
if (ntree->update & (NTREE_UPDATE_LINKS | NTREE_UPDATE_NODES)) {