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:
authorSybren A. Stüvel <sybren@stuvel.eu>2016-10-13 14:32:08 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2016-10-13 15:10:46 +0300
commit5c651554e2f98bff1cfdff0a6a6f029453dc3309 (patch)
treeff2a3fb6c6b95f681321ec08469de959206ddd25 /source/blender/blenkernel/intern/object.c
parent918e6cf4c9b74ff96ad06753ef9e541837eb3b22 (diff)
Proxy appending: re-establish link to proxies when they are made local
This allows appending of an entire scene from another blend file into this one, even when that blend file contains proxified armatures. This replaces the approach from commit 1cdc54dc7db85766. Thanks @sergey for the help.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index a059055a49e..5bcf31ba45b 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1181,7 +1181,7 @@ Object *BKE_object_copy(Main *bmain, Object *ob)
return BKE_object_copy_ex(bmain, ob, false);
}
-void BKE_object_make_local(Main *bmain, Object *ob, const bool lib_local)
+void BKE_object_make_local_ex(Main *bmain, Object *ob, const bool lib_local, const bool clear_proxy)
{
bool is_local = false, is_lib = false;
@@ -1201,6 +1201,13 @@ void BKE_object_make_local(Main *bmain, Object *ob, const bool lib_local)
if (!is_lib) {
id_clear_lib_data(bmain, &ob->id);
BKE_id_expand_local(&ob->id);
+ if (clear_proxy) {
+ if (ob->proxy_from != NULL) {
+ ob->proxy_from->proxy = NULL;
+ ob->proxy_from->proxy_group = NULL;
+ }
+ ob->proxy = ob->proxy_from = ob->proxy_group = NULL;
+ }
}
else {
Object *ob_new = BKE_object_copy(bmain, ob);
@@ -1215,6 +1222,11 @@ void BKE_object_make_local(Main *bmain, Object *ob, const bool lib_local)
}
}
+void BKE_object_make_local(Main *bmain, Object *ob, const bool lib_local)
+{
+ BKE_object_make_local_ex(bmain, ob, lib_local, true);
+}
+
/* Returns true if the Object is from an external blend file (libdata) */
bool BKE_object_is_libdata(Object *ob)
{