From b7e84f32adb3b6e6189a9acc95804fdfb675c669 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 6 Jul 2016 14:37:03 +0200 Subject: Cleanup/simplify/fixes BKE_object_is_libdata and BKE_object_obdata_is_libdata. Removed checks for ob->proxy from the equation, you can totally have proxy objects linked into another .blend file! --- source/blender/blenkernel/intern/object.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 316e74625f0..22ab232bf43 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1273,27 +1273,18 @@ void BKE_object_make_local(Object *ob) } } -/* - * Returns true if the Object is a from an external blend file (libdata) - */ +/* Returns true if the Object is from an external blend file (libdata) */ bool BKE_object_is_libdata(Object *ob) { - if (!ob) return false; - if (ob->proxy) return false; - if (ID_IS_LINKED_DATABLOCK(ob)) return true; - return false; + return (ob && ID_IS_LINKED_DATABLOCK(ob)); } -/* Returns true if the Object data is a from an external blend file (libdata) */ +/* Returns true if the Object data is from an external blend file (libdata) */ bool BKE_object_obdata_is_libdata(Object *ob) { - if (!ob) return false; - if (ob->proxy && (ob->data == NULL || !ID_IS_LINKED_DATABLOCK(ob->data))) return false; - if (ID_IS_LINKED_DATABLOCK(ob)) return true; - if (ob->data == NULL) return false; - if (ID_IS_LINKED_DATABLOCK(ob->data)) return true; - - return false; + /* Linked objects with local obdata are forbidden! */ + BLI_assert(!ob || !ob->data || (ID_IS_LINKED_DATABLOCK(ob) ? ID_IS_LINKED_DATABLOCK(ob->data) : true)); + return (ob && ob->data && ID_IS_LINKED_DATABLOCK(ob->data)); } /* *************** PROXY **************** */ -- cgit v1.2.3