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:
authorPhilipp Oeser <info@graphics-engineer.com>2022-01-04 12:25:12 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-01-11 16:16:00 +0300
commit9bae5988ba819065ad715e8e5124179797385db9 (patch)
tree4cb37ccf78e3ad06f6c0f3ad724aa59c46612791
parent20d0cddc608af6740715712932f1cbf69f10e51f (diff)
Fix T94544: crash removing image used as camera background via python
Since 2.8, background images are tied to cameras (in 2.79 these were tied to a View3D I think). Code in `BKE_library_id_can_use_idtype` wasnt taking this relation between `Camera` and `Image` into account, thus leading to ID deletion/ unlinking not working properly -- in particular `libblock_remap_data` not doing its thing (and leaving the camera as a user of the image), then things went downhill from there... Now make the "Camera-can-use-an-Image" relation clear in `BKE_library_id_can_use_idtype`. Maniphest Tasks: T94544 Differential Revision: https://developer.blender.org/D13722
-rw-r--r--source/blender/blenkernel/intern/lib_query.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index cbbe07f99d8..3cc7332b362 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -406,7 +406,7 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used)
case ID_LA:
return (ELEM(id_type_used, ID_TE));
case ID_CA:
- return ELEM(id_type_used, ID_OB);
+ return ELEM(id_type_used, ID_OB, ID_IM);
case ID_KE:
/* Warning! key->from, could be more types in future? */
return ELEM(id_type_used, ID_ME, ID_CU, ID_LT);