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-05-02 17:14:33 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-02 17:15:52 +0300
commitce7575c823f169747af870058334395cc9bf7b10 (patch)
tree54a53bddfe9edd7f6e0f89baffa68a2d396ae89c
parent40771a0e9e0ce5797cb413840d958c879e677a62 (diff)
Static Override: Move 'auto' flag into override struct, expose it to RNA.
-rw-r--r--source/blender/blenkernel/intern/library_override.c4
-rw-r--r--source/blender/editors/object/object_relations.c2
-rw-r--r--source/blender/makesdna/DNA_ID.h9
-rw-r--r--source/blender/makesrna/intern/rna_ID.c5
4 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/library_override.c b/source/blender/blenkernel/intern/library_override.c
index 8917fac198c..9f3cc578d2a 100644
--- a/source/blender/blenkernel/intern/library_override.c
+++ b/source/blender/blenkernel/intern/library_override.c
@@ -163,7 +163,7 @@ static ID *override_static_create_from(Main *bmain, ID *reference_id)
id_us_min(local_id);
BKE_override_static_init(local_id, reference_id);
- local_id->flag |= LIB_OVERRIDE_STATIC_AUTO;
+ local_id->flag |= STATICOVERRIDE_AUTO;
return local_id;
}
@@ -534,7 +534,7 @@ bool BKE_override_static_operations_create(ID *local, const bool force_auto)
const bool is_template = (local->override_static->reference == NULL);
bool ret = false;
- if (!is_template && (force_auto || local->flag & LIB_OVERRIDE_STATIC_AUTO)) {
+ if (!is_template && (force_auto || local->override_static->flag & STATICOVERRIDE_AUTO)) {
PointerRNA rnaptr_local, rnaptr_reference;
RNA_id_pointer_create(local, &rnaptr_local);
RNA_id_pointer_create(local->override_static->reference, &rnaptr_reference);
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index fe53902d9a4..ee1ef490274 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2332,7 +2332,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
}
else {
/* Disable auto-override tags for non-active objects, will help with performaces... */
- new_ob->id.flag &= ~LIB_OVERRIDE_STATIC_AUTO;
+ new_ob->id.override_static->flag &= ~STATICOVERRIDE_AUTO;
}
/* We still want to store all objects' current override status (i.e. change of parent). */
BKE_override_static_operations_create(&new_ob->id, true);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index bcce2764eaf..acf054a94d5 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -181,12 +181,18 @@ typedef struct IDOverrideStatic {
struct ID *reference; /* Reference linked ID which this one overrides. */
ListBase properties; /* List of IDOverrideProperty structs. */
+ short flag;
+ short pad[3];
+
/* Read/write data. */
/* Temp ID storing extra override data (used for differential operations only currently).
* Always NULL outside of read/write context. */
struct ID *storage;
} IDOverrideStatic;
+enum eStaticOverride_Flag {
+ STATICOVERRIDE_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */
+};
/* watch it: Sequence has identical beginning. */
/**
@@ -389,7 +395,7 @@ typedef enum ID_Type {
#define ID_IS_STATIC_OVERRIDE_AUTO(_id) (!ID_IS_LINKED((_id)) && \
ID_IS_STATIC_OVERRIDE((_id)) && \
- (((ID *)(_id))->flag & LIB_OVERRIDE_STATIC_AUTO))
+ (((ID *)(_id))->override_static->flag & STATICOVERRIDE_AUTO))
#ifdef GS
# undef GS
@@ -402,7 +408,6 @@ typedef enum ID_Type {
/* id->flag (persitent). */
enum {
- LIB_OVERRIDE_STATIC_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */
LIB_FAKEUSER = 1 << 9,
};
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index deb9e20f34b..a07e43162c2 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -1106,12 +1106,17 @@ static void rna_def_ID_override_static_property(BlenderRNA *brna)
static void rna_def_ID_override_static(BlenderRNA *brna)
{
StructRNA *srna;
+ PropertyRNA *prop;
srna = RNA_def_struct(brna, "IDOverrideStatic", NULL);
RNA_def_struct_ui_text(srna, "ID Static Override", "Struct gathering all data needed by statically overridden IDs");
RNA_def_pointer(srna, "reference", "ID", "Reference ID", "Linked ID used as reference by this override");
+ prop = RNA_def_boolean(srna, "auto_generate", true, "Auto Generate Override",
+ "Automatically generate overriding operations by detecting changes in properties");
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", STATICOVERRIDE_AUTO);
+
RNA_def_collection(srna, "properties", "IDOverrideStaticProperty", "Properties",
"List of overridden properties");