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:
authorMartin Felke <martin.felke@googlemail.com>2016-01-04 16:02:05 +0300
committerMartin Felke <martin.felke@googlemail.com>2016-01-04 16:02:30 +0300
commit8608a0f4f0e17e14d0b2d560914767c776778619 (patch)
tree3c043aff2de1d976d42bd464003e3930d570901f /source/blender/blenkernel
parent2cdd4a5467984e3d1cbff50436debcd2d44d71b6 (diff)
added new "Fake User" option for appending objects, this sets a fake user on each newly appended item except Groups and Objects.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_library.h2
-rw-r--r--source/blender/blenkernel/intern/blender.c2
-rw-r--r--source/blender/blenkernel/intern/library.c10
3 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index 7af126faa6a..9c5e5e5f208 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -116,7 +116,7 @@ void BKE_main_lib_objects_recalc_all(struct Main *bmain);
/* (MAX_ID_NAME - 2) + 3 */
void BKE_id_ui_prefix(char name[66 + 1], const struct ID *id);
-void BKE_library_make_local(struct Main *bmain, struct Library *lib, bool untagged_only);
+void BKE_library_make_local(struct Main *bmain, struct Library *lib, bool untagged_only, bool set_fake);
typedef void (*BKE_library_free_window_manager_cb)(struct bContext *, struct wmWindowManager *);
typedef void (*BKE_library_free_notifier_reference_cb)(const void *);
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 8b447379d01..ef9cce349ca 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -1080,7 +1080,7 @@ int BKE_copybuffer_paste(bContext *C, const char *libname, ReportList *reports)
/* append, rather than linking */
lib = BLI_findstring(&bmain->library, libname, offsetof(Library, filepath));
- BKE_library_make_local(bmain, lib, true);
+ BKE_library_make_local(bmain, lib, true, false);
/* important we unset, otherwise these object wont
* link into other scenes from this blend file */
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index bfee7c10400..736b2f69442 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1760,7 +1760,7 @@ void BKE_main_id_tag_all(struct Main *mainvar, const bool tag)
/* if lib!=NULL, only all from lib local
* bmain is almost certainly G.main */
-void BKE_library_make_local(Main *bmain, Library *lib, bool untagged_only)
+void BKE_library_make_local(Main *bmain, Library *lib, bool untagged_only, bool set_fake)
{
ListBase *lbarray[MAX_LIBARRAY];
ID *id, *idn;
@@ -1797,7 +1797,15 @@ void BKE_library_make_local(Main *bmain, Library *lib, bool untagged_only)
id->tag &= ~(LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW);
}
}
+
+ if (set_fake) {
+ if (!ELEM( GS(id->name), ID_OB, ID_GR)) {
+ /* do not set fake user on objects, groups (instancing) */
+ id_fake_user_set(id);
+ }
+ }
}
+
id = idn;
}
}