Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-07-25 17:15:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-07-25 17:16:35 +0300
commit1870e166deaa4ced1bb5226e97e037db10dbd06c (patch)
tree9d6e51e7b210efcde111ebf246211c2c44e9c8fe /source/blender/blenkernel/intern/library.c
parentd9cc3ea2c6e8cfd17612c35a82050cb01d8070ec (diff)
Cleanup: factorize the 'ensure local' part of datablock copy into a single BKE_id_copy_ensure_local function.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index c31df685136..ce70e5da82f 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -272,6 +272,17 @@ void BKE_id_expand_local(ID *id)
}
/**
+ * Ensure new (copied) ID is fully made local.
+ */
+void BKE_id_copy_ensure_local(Main *bmain, ID *old_id, ID *new_id)
+{
+ if (ID_IS_LINKED_DATABLOCK(old_id)) {
+ BKE_id_expand_local(new_id);
+ BKE_id_lib_local_paths(bmain, old_id->lib, new_id);
+ }
+}
+
+/**
* Generic 'make local' function, works for most of datablock types...
*/
void BKE_id_make_local_generic(Main *bmain, ID *id, const bool id_in_mainlist, const bool lib_local)