Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-02-18 18:15:14 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-18 19:16:33 +0300
commitff7165957f467b2a4428fe0944f18ccb95ab4186 (patch)
tree9ec6ffedffe37547189f20191a989b909f8eeb14 /source/blender/blenkernel/intern/library_remap.c
parent0951778ebaabd70af6cebb325472c6754a07555c (diff)
ID management: use FOREACH_MAIN_ID in some places.
Diffstat (limited to 'source/blender/blenkernel/intern/library_remap.c')
-rw-r--r--source/blender/blenkernel/intern/library_remap.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c
index 93ea5c35213..c8be98bb695 100644
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@ -398,8 +398,6 @@ ATTR_NONNULL(1) static void libblock_remap_data(
Main *bmain, ID *id, ID *old_id, ID *new_id, const short remap_flags, IDRemap *r_id_remap_data)
{
IDRemap id_remap_data;
- ListBase *lb_array[MAX_LIBARRAY];
- int i;
const int foreach_id_flags = (remap_flags & ID_REMAP_NO_INDIRECT_PROXY_DATA_USAGE) != 0 ? IDWALK_NO_INDIRECT_PROXY_DATA_USAGE : IDWALK_NOP;
if (r_id_remap_data == NULL) {
@@ -424,24 +422,23 @@ ATTR_NONNULL(1) static void libblock_remap_data(
BKE_library_foreach_ID_link(NULL, id, foreach_libblock_remap_callback, (void *)r_id_remap_data, foreach_id_flags);
}
else {
- i = set_listbasepointers(bmain, lb_array);
-
/* Note that this is a very 'brute force' approach, maybe we could use some depsgraph to only process
* objects actually using given old_id... sounds rather unlikely currently, though, so this will do for now. */
+ ID *id_curr;
- while (i--) {
- for (ID *id_curr = lb_array[i]->first; id_curr; id_curr = id_curr->next) {
- if (BKE_library_id_can_use_idtype(id_curr, GS(old_id->name))) {
- /* Note that we cannot skip indirect usages of old_id here (if requested), we still need to check it for
- * the user count handling...
- * XXX No more true (except for debug usage of those skipping counters). */
- r_id_remap_data->id = id_curr;
- libblock_remap_data_preprocess(r_id_remap_data);
- BKE_library_foreach_ID_link(
- NULL, id_curr, foreach_libblock_remap_callback, (void *)r_id_remap_data, foreach_id_flags);
- }
+ FOREACH_MAIN_ID_BEGIN(bmain, id_curr)
+ {
+ if (BKE_library_id_can_use_idtype(id_curr, GS(old_id->name))) {
+ /* Note that we cannot skip indirect usages of old_id here (if requested), we still need to check it for
+ * the user count handling...
+ * XXX No more true (except for debug usage of those skipping counters). */
+ r_id_remap_data->id = id_curr;
+ libblock_remap_data_preprocess(r_id_remap_data);
+ BKE_library_foreach_ID_link(
+ NULL, id_curr, foreach_libblock_remap_callback, (void *)r_id_remap_data, foreach_id_flags);
}
}
+ FOREACH_MAIN_ID_END;
}
/* XXX We may not want to always 'transfer' fakeuser from old to new id... Think for now it's desired behavior