Fix T49991: reloading librairies doesn't update node groups.
We need to check node tree links are still valid, after we remapped some NodeGroup. Note: In fact, we have to run that for *all* ID types, since nodes may use any kind of data-block (in theory)... :/
This commit is contained in:
parent
fa6a62fac2
commit
369872a2c5
Notes:
blender-bot
2023-02-14 08:47:25 +01:00
Referenced by issue #49991, reloading librairies doesn't update node groups
|
@ -378,6 +378,18 @@ static void libblock_remap_data_postprocess_obdata_relink(Main *UNUSED(bmain), O
|
|||
}
|
||||
}
|
||||
|
||||
static void libblock_remap_data_postprocess_nodetree_update(Main *bmain, ID *new_id)
|
||||
{
|
||||
/* Verify all nodetree user nodes. */
|
||||
ntreeVerifyNodes(bmain, new_id);
|
||||
|
||||
/* Update node trees as necessary. */
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
/* make an update call for the tree */
|
||||
ntreeUpdateTree(bmain, ntree);
|
||||
} FOREACH_NODETREE_END
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the 'data' part of the remapping (that is, all ID pointers from other ID datablocks).
|
||||
*
|
||||
|
@ -551,6 +563,8 @@ void BKE_libblock_remap_locked(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
/* Node trees may virtually use any kind of data-block... */
|
||||
libblock_remap_data_postprocess_nodetree_update(bmain, new_id);
|
||||
|
||||
/* Full rebuild of DAG! */
|
||||
DAG_relations_tag_update(bmain);
|
||||
|
|
Loading…
Reference in New Issue