Fix T51902: Severe problem with relocating linked libraries when using proxies.
Fix is a bit ugly, but cannot think of another solution for now, at least this **should** not break anything else. And now I go find myself a very remote, high and lonely mountain, climb to its top, roar "I hate proxies!" a few times, and relax hearing the echos...
This commit is contained in:
@@ -512,7 +512,8 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
|
||||
|
||||
/* Object is special, proxies make things hard... */
|
||||
const int data_cb_flag = data.cb_flag;
|
||||
const int proxy_cb_flag = (object->proxy || object->proxy_group) ? IDWALK_CB_INDIRECT_USAGE : 0;
|
||||
const int proxy_cb_flag = ((data.flag & IDWALK_NO_INDIRECT_PROXY_DATA_USAGE) == 0 && (object->proxy || object->proxy_group)) ?
|
||||
IDWALK_CB_INDIRECT_USAGE : 0;
|
||||
|
||||
/* object data special case */
|
||||
data.cb_flag |= proxy_cb_flag;
|
||||
|
||||
@@ -419,6 +419,7 @@ ATTR_NONNULL(1) static void libblock_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) {
|
||||
r_id_remap_data = &id_remap_data;
|
||||
@@ -439,7 +440,7 @@ ATTR_NONNULL(1) static void libblock_remap_data(
|
||||
#endif
|
||||
r_id_remap_data->id = id;
|
||||
libblock_remap_data_preprocess(r_id_remap_data);
|
||||
BKE_library_foreach_ID_link(NULL, id, foreach_libblock_remap_callback, (void *)r_id_remap_data, IDWALK_NOP);
|
||||
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);
|
||||
@@ -456,7 +457,7 @@ ATTR_NONNULL(1) static void libblock_remap_data(
|
||||
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, IDWALK_NOP);
|
||||
NULL, id_curr, foreach_libblock_remap_callback, (void *)r_id_remap_data, foreach_id_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user