[Bf-blender-cvs] [22ce804c7da] blender-v2.83-release: Fix T94544: crash removing image used as camera background via python
Philipp Oeser
noreply at git.blender.org
Tue Jan 18 10:54:16 CET 2022
Commit: 22ce804c7dad335fc53a5c4c90515864f6ae7b68
Author: Philipp Oeser
Date: Tue Jan 4 10:25:12 2022 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rB22ce804c7dad335fc53a5c4c90515864f6ae7b68
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
===================================================================
M source/blender/blenkernel/intern/lib_query.c
===================================================================
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index baae1e55897..a836abc9242 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -1369,7 +1369,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);
More information about the Bf-blender-cvs
mailing list