diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-25 20:33:55 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-25 20:33:55 +0300 |
commit | bcc020b1bc1b60f6cbd6d2c9bf400744931e57e1 (patch) | |
tree | fef4d83d0e5addb59c8389adf125281a4c7e35f8 /source/blender/blenkernel/intern/curve.c | |
parent | 99bb1accbbb8e1ba38f30b073b22deb107bf3220 (diff) | |
parent | 3f36cd3f33e52d53d82a3a221e2a576cf26390a5 (diff) |
Merge branch 'asset-engine' into asset-experimentsasset-experiments
Conflicts:
source/blender/blenloader/intern/readfile.c
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 0e634e21ea3..90a514781d7 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -207,45 +207,14 @@ Curve *BKE_curve_copy(Main *bmain, Curve *cu) id_us_plus((ID *)cun->vfonti); id_us_plus((ID *)cun->vfontbi); - if (ID_IS_LINKED_DATABLOCK(cu)) { - BKE_id_expand_local(&cun->id); - BKE_id_lib_local_paths(bmain, cu->id.lib, &cun->id); - } + BKE_id_copy_ensure_local(bmain, &cu->id, &cun->id); return cun; } -void BKE_curve_make_local(Main *bmain, Curve *cu) +void BKE_curve_make_local(Main *bmain, Curve *cu, const bool lib_local) { - bool is_local = false, is_lib = false; - - /* - when there are only lib users: don't do - * - when there are only local users: set flag - * - mixed: do a copy - */ - - if (!ID_IS_LINKED_DATABLOCK(cu)) { - return; - } - - BKE_library_ID_test_usages(bmain, cu, &is_local, &is_lib); - - if (is_local) { - if (!is_lib) { - id_clear_lib_data(bmain, &cu->id); - if (cu->key) { - BKE_key_make_local(bmain, cu->key); - } - BKE_id_expand_local(&cu->id); - } - else { - Curve *cu_new = BKE_curve_copy(bmain, cu); - - cu_new->id.us = 0; - - BKE_libblock_remap(bmain, cu, cu_new, ID_REMAP_SKIP_INDIRECT_USAGE); - } - } + BKE_id_make_local_generic(bmain, &cu->id, true, lib_local); } /* Get list of nurbs from editnurbs structure */ |