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>2018-10-19 17:42:42 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-10-19 19:38:19 +0300
commitfbf4c11960db62a27876e1d791d3293071e26c76 (patch)
tree8b51aa88f16ba18884b3d9120636f66052474a8e /source/blender/blenkernel
parente6fe207a52b1d3f46f02c3d01973ae501c97ba49 (diff)
Make Static Override optional/hidden by default.
That feature will not be ready (or at least, not tested enough) to be officially part of 2.80 beta. So we disable it by default, hidding it behind a startup option (`--enable-static-override`), and a python app var (`bpy.app.use_static_override`). That way, people who really want to play with it can do it easily, while not exposing/enabling non-production-ready feature by default. Note that underlying override code remains active, i.e. files we do have overridden data-blocks will be loaded correctly according to static override.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_library_override.h3
-rw-r--r--source/blender/blenkernel/intern/library_override.c13
-rw-r--r--source/blender/blenkernel/intern/undo_system.c4
3 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_library_override.h b/source/blender/blenkernel/BKE_library_override.h
index 4792d203d23..b6642bfa726 100644
--- a/source/blender/blenkernel/BKE_library_override.h
+++ b/source/blender/blenkernel/BKE_library_override.h
@@ -38,6 +38,9 @@ struct IDOverrideStaticProperty;
struct IDOverrideStaticPropertyOperation;
struct Main;
+void BKE_override_static_enable(const bool do_enable);
+bool BKE_override_static_is_enabled(void);
+
struct IDOverrideStatic *BKE_override_static_init(struct ID *local_id, struct ID *reference_id);
void BKE_override_static_copy(struct ID *dst_id, const struct ID *src_id);
void BKE_override_static_clear(struct IDOverrideStatic *override);
diff --git a/source/blender/blenkernel/intern/library_override.c b/source/blender/blenkernel/intern/library_override.c
index 35437c1c9b9..714730b2f52 100644
--- a/source/blender/blenkernel/intern/library_override.c
+++ b/source/blender/blenkernel/intern/library_override.c
@@ -59,6 +59,19 @@ static void bke_override_property_operation_copy(IDOverrideStaticPropertyOperati
static void bke_override_property_clear(IDOverrideStaticProperty *op);
static void bke_override_property_operation_clear(IDOverrideStaticPropertyOperation *opop);
+/* Temp, for until static override is ready and tested enough to go 'public', we hide it by default in UI and such. */
+static bool _override_static_enabled = false;
+
+void BKE_override_static_enable(const bool do_enable)
+{
+ _override_static_enabled = do_enable;
+}
+
+bool BKE_override_static_is_enabled()
+{
+ return _override_static_enabled;
+}
+
/** Initialize empty overriding of \a reference_id by \a local_id. */
IDOverrideStatic *BKE_override_static_init(ID *local_id, ID *reference_id)
{
diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index 0eb209cabeb..ae98a765124 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -425,7 +425,9 @@ bool BKE_undosys_step_push_with_type(UndoStack *ustack, bContext *C, const char
/* Might not be final place for this to be called - probably only want to call it from some
* undo handlers, not all of them? */
- BKE_main_override_static_operations_create(G.main, false);
+ if (BKE_override_static_is_enabled()) {
+ BKE_main_override_static_operations_create(G.main, false);
+ }
/* Remove all undos after (also when 'ustack->step_active == NULL'). */
while (ustack->steps.last != ustack->step_active) {