diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-06 15:37:03 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-06 15:37:03 +0300 |
commit | b7e84f32adb3b6e6189a9acc95804fdfb675c669 (patch) | |
tree | d592696a8eaf85f69fc0323d77acbbf2e4f55274 /source | |
parent | d2312602125a452e6562a76ab91779943c67396d (diff) |
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!
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 21 |
1 files changed, 6 insertions, 15 deletions
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 **************** */ |