Fix (unreported) improper handling of camera's baground image IDs in foreach_id callback.

`foreach_id` callbacks should not decide whether a given ID pointers
should be processed or not (unless maybe some extremely specific cases).

Even if an ID pointer is not currently 'used', it still needs to
increment its ID user count, be remapped to a new pointer, etc. etc.
This commit is contained in:
Bastien Montagne
2023-08-14 18:17:13 +02:00
parent 2661747138
commit e2a5846d56
+2 -6
View File
@@ -98,12 +98,8 @@ static void camera_foreach_id(ID *id, LibraryForeachIDData *data)
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, camera->dof.focus_object, IDWALK_CB_NOP);
LISTBASE_FOREACH (CameraBGImage *, bgpic, &camera->bg_images) {
if (bgpic->source == CAM_BGIMG_SOURCE_IMAGE) {
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, bgpic->ima, IDWALK_CB_USER);
}
else if (bgpic->source == CAM_BGIMG_SOURCE_MOVIE) {
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, bgpic->clip, IDWALK_CB_USER);
}
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, bgpic->ima, IDWALK_CB_USER);
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, bgpic->clip, IDWALK_CB_USER);
}
}