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 <b.mont29@gmail.com>2020-03-04 13:42:15 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-03-04 13:43:31 +0300
commit4bfa256ea48e51643f848e8dfdaeab615f7b1a88 (patch)
tree996d59300eeff16f1063a6be8887aaa3cfcb4299 /source/blender/blenkernel/BKE_lib_id.h
parent4e597a5cff6bb4195b8fc9c8102bfbdc4958b31f (diff)
Refactor ID make local to use a single flag parameter.
Instead of using anonymous booleans flags, also allows to keep the same behavior in all cases, without needing special handling from calling code for our beloved oddballs object proxies...
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_id.h')
-rw-r--r--source/blender/blenkernel/BKE_lib_id.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index fc4612554e9..cb86d54009b 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -190,11 +190,18 @@ void id_fake_user_set(struct ID *id);
void id_fake_user_clear(struct ID *id);
void BKE_id_clear_newpoin(struct ID *id);
-void BKE_lib_id_make_local_generic(struct Main *bmain, struct ID *id, const bool lib_local);
-bool BKE_lib_id_make_local(struct Main *bmain,
- struct ID *id,
- const bool test,
- const bool force_local);
+/** Flags to control make local code behaviour. */
+enum {
+ /** Making that ID local is part of making local a whole library. */
+ LIB_ID_MAKELOCAL_FULL_LIBRARY = 1 << 0,
+
+ /* Special type-specific options. */
+ /** For Objects, do not clear the proxy pointers while making the data-block local. */
+ LIB_ID_MAKELOCAL_OBJECT_NO_PROXY_CLEARING = 1 << 16,
+};
+
+void BKE_lib_id_make_local_generic(struct Main *bmain, struct ID *id, const int flags);
+bool BKE_lib_id_make_local(struct Main *bmain, struct ID *id, const bool test, const int flags);
bool id_single_user(struct bContext *C,
struct ID *id,
struct PointerRNA *ptr,