diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-18 21:17:44 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-18 21:20:55 +0300 |
commit | 9fb59244466aa07c9addaf17bdb65192682bde87 (patch) | |
tree | 607d48fd8fe5beaebf28d529a0d15cb49af6091b /source/blender/blenkernel/intern/library_query.c | |
parent | 176bbe346673edfac3e0aaeeba6ccfa40cd4f377 (diff) |
Fix a very nasty and sneaky bug in lib remap / static override code.
Not sure why remap call for static override reference ID pointer was put
there, probably a mistake during some merge back in the days...
But this ended up with self_id of libquery data struct still being set
to previous ID pointer, which could randomly generate crap like falsly
reporting indirect data and such, leading to lost reference datablock at
writefile time...
Diffstat (limited to 'source/blender/blenkernel/intern/library_query.c')
-rw-r--r-- | source/blender/blenkernel/intern/library_query.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index 37b5b62b06e..f23d8720a65 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -352,10 +352,6 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call #define CALLBACK_INVOKE(check_id_super, cb_flag) \ FOREACH_CALLBACK_INVOKE(&data, check_id_super, cb_flag) - if (id->override_static != NULL) { - CALLBACK_INVOKE_ID(id->override_static->reference, IDWALK_CB_USER | IDWALK_CB_STATIC_OVERRIDE_REFERENCE); - } - for (; id != NULL; id = (flag & IDWALK_RECURSE) ? BLI_LINKSTACK_POP(data.ids_todo) : NULL) { data.self_id = id; data.cb_flag = ID_IS_LINKED(id) ? IDWALK_CB_INDIRECT_USAGE : 0; @@ -372,6 +368,11 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call continue; } + if (id->override_static != NULL) { + CALLBACK_INVOKE_ID(id->override_static->reference, IDWALK_CB_USER | IDWALK_CB_STATIC_OVERRIDE_REFERENCE); + CALLBACK_INVOKE_ID(id->override_static->storage, IDWALK_CB_USER | IDWALK_CB_STATIC_OVERRIDE_REFERENCE); + } + library_foreach_idproperty_ID_link(&data, id->properties, IDWALK_CB_USER); AnimData *adt = BKE_animdata_from_id(id); |