From 351a9d084f59a6d11be9148830cec86eacb85529 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 4 Jan 2017 10:25:27 +0100 Subject: Fix T50369: Objects can't be deleted from scene when using "link group objects to scene" Main issue here was that in old usercount system 'user_real' did simply not allow that kind of thing to work. With new pait of 'USER_EXTRA' tags, it becomes possible to handle the case correctly, by merely refining checks about indirectly use objects whene removing them from a scene. Incidently, found another related bug, 'link group objects to scene' was not incrementing objects' usercount - bad, very very bad! --- source/blender/makesdna/DNA_ID.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index ed719b66eb3..2c6f3d2fc66 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -277,6 +277,7 @@ typedef enum ID_Type { #define ID_FAKE_USERS(id) ((((ID *)id)->flag & LIB_FAKEUSER) ? 1 : 0) #define ID_REAL_USERS(id) (((ID *)id)->us - ID_FAKE_USERS(id)) +#define ID_EXTRA_USERS(id) (((ID *)id)->tag & LIB_TAG_EXTRAUSER ? 1 : 0) #define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM)) -- cgit v1.2.3