From 2cec60e2ebd243e3bf3216c70f465a717b9de29a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 25 Apr 2010 00:19:10 +0000 Subject: [PATCH] fix for a library linking problem where a proxy object linked into a blend would cause the proxy, driver's ID to be directly linked as well. eg. character.blend -> anim.blend -> comp.blend ... Would link the character.blend directly into comp.blend because on driver ID's. In this case id_lib_extern doenst need to be called because the object its linked from is a library. --- source/blender/blenkernel/intern/object.c | 14 ++++++++++---- source/blender/makesdna/DNA_ID.h | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 6206696e109..ce064a78cff 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1469,10 +1469,16 @@ void object_copy_proxy_drivers(Object *ob, Object *target) /* all drivers */ DRIVER_TARGETS_LOOPER(dvar) { - if ((Object *)dtar->id == target) - dtar->id= (ID *)ob; - else - id_lib_extern((ID *)dtar->id); + if(dtar->id) { + if ((Object *)dtar->id == target) + dtar->id= (ID *)ob; + else { + /* only on local objects because this causes indirect links a -> b -> c,blend to point directly to a.blend + * when a.blend has a proxy thats linked into c.blend */ + if(ob->id.lib==NULL) + id_lib_extern((ID *)dtar->id); + } + } } DRIVER_TARGETS_LOOPER_END } diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 1eddbb26168..55b8374656a 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -205,8 +205,8 @@ typedef struct PreviewImage { #define LIB_EXTERN 1 #define LIB_INDIRECT 2 #define LIB_TEST 8 -#define LIB_TESTEXT 9 -#define LIB_TESTIND 10 +#define LIB_TESTEXT (LIB_TEST | LIB_EXTERN) +#define LIB_TESTIND (LIB_TEST | LIB_INDIRECT) #define LIB_READ 16 #define LIB_NEEDLINK 32