diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-19 14:20:29 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-19 14:31:40 +0300 |
commit | 369872a2c50e95eee822512018cc282ef5fcfdd1 (patch) | |
tree | dd23bfd5a381ed3bb8842c4cf60fa381a2ffac3a /source | |
parent | fa6a62fac2a394e66e779c0dc4aef0f9d840ab87 (diff) |
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)... :/
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/library_remap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 40441034171..62f59832481 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -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); |