Cleanup: factorize the 'ensure local' part of datablock copy into a single BKE_id_copy_ensure_local function.

This commit is contained in:
2016-07-25 16:15:37 +02:00
parent d9cc3ea2c6
commit 1870e166de
24 changed files with 34 additions and 88 deletions

View File

@@ -1169,10 +1169,7 @@ Object *BKE_object_copy_ex(Main *bmain, Object *ob, bool copy_caches)
/* Copy runtime surve data. */
obn->curve_cache = NULL;
if (ID_IS_LINKED_DATABLOCK(ob)) {
BKE_id_expand_local(&obn->id);
BKE_id_lib_local_paths(bmain, ob->id.lib, &obn->id);
}
BKE_id_copy_ensure_local(bmain, &ob->id, &obn->id);
/* Do not copy object's preview (mostly due to the fact renderers create temp copy of objects). */
obn->preview = NULL;