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:
authorJacques Lucke <jacques@blender.org>2020-11-09 14:44:45 +0300
committerJacques Lucke <jacques@blender.org>2020-11-09 14:44:45 +0300
commitd2c4af98657e8a6cd7d3486ab000b555b9cda4b4 (patch)
tree94f17de1f7f7d0beb4c93067a7db71bcdd6a30cb /source/blender/makesrna/intern
parente5c637f5fea31251f49980f0ef6eb19695a6cba2 (diff)
parent92083772e73a68bf74702aceb0fcb759a6b2419c (diff)
Merge branch 'master' into geometry-nodes
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt2
-rw-r--r--source/blender/makesrna/intern/makesrna.c4
-rw-r--r--source/blender/makesrna/intern/rna_access.c106
-rw-r--r--source/blender/makesrna/intern/rna_access_compare_override.c2
-rw-r--r--source/blender/makesrna/intern/rna_define.c23
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c30
-rw-r--r--source/blender/makesrna/intern/rna_space.c17
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c18
8 files changed, 98 insertions, 104 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 4de560c5d4b..3ebbb98934e 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -379,7 +379,7 @@ blender_include_dirs(
../../simulation
../../windowmanager
../../editors/include
- ../../render/extern/include
+ ../../render
../../../../intern/cycles/blender
../../../../intern/atomic
../../../../intern/glew-mx
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 5aa684539af..8b861d20e4e 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -256,10 +256,10 @@ static const char *rna_safe_id(const char *id)
if (STREQ(id, "operator")) {
return "operator_value";
}
- else if (STREQ(id, "new")) {
+ if (STREQ(id, "new")) {
return "create";
}
- else if (STREQ(id, "co_return")) {
+ if (STREQ(id, "co_return")) {
/* MSVC2015, C++ uses for coroutines */
return "coord_return";
}
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index e71bbc6bcaf..8405a6e2667 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -425,9 +425,7 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
if (idprop->type == IDP_ARRAY) {
return idprop->len;
}
- else {
- return 0;
- }
+ return 0;
}
static bool rna_ensure_property_array_check(PropertyRNA *prop)
@@ -1268,7 +1266,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
PROP_COORDS)) {
return vectoritem[index];
}
- else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
+ if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
return coloritem[index];
}
@@ -1533,9 +1531,7 @@ int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value)
*value = max;
return 1;
}
- else {
- return 0;
- }
+ return 0;
}
int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
@@ -1552,9 +1548,7 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
*value = max;
return 1;
}
- else {
- return 0;
- }
+ return 0;
}
/* this is the max length including \0 terminator.
@@ -1668,7 +1662,7 @@ void RNA_property_enum_items(bContext *C,
#ifdef WITH_INTERNATIONAL
static void property_enum_translate(PropertyRNA *prop,
EnumPropertyItem **r_item,
- int *r_totitem,
+ const int *totitem,
bool *r_free)
{
if (!(prop->flag & PROP_ENUM_NO_TRANSLATE)) {
@@ -1690,8 +1684,8 @@ static void property_enum_translate(PropertyRNA *prop,
const EnumPropertyItem *item = *r_item;
int tot;
- if (r_totitem) {
- tot = *r_totitem;
+ if (totitem) {
+ tot = *totitem;
}
else {
/* count */
@@ -2614,12 +2608,10 @@ int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
if (iprop->get) {
return iprop->get(ptr);
}
- else if (iprop->get_ex) {
+ if (iprop->get_ex) {
return iprop->get_ex(ptr, prop);
}
- else {
- return iprop->defaultvalue;
- }
+ return iprop->defaultvalue;
}
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
@@ -2950,15 +2942,13 @@ float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
}
return (float)IDP_Double(idprop);
}
- else if (fprop->get) {
+ if (fprop->get) {
return fprop->get(ptr);
}
- else if (fprop->get_ex) {
+ if (fprop->get_ex) {
return fprop->get_ex(ptr, prop);
}
- else {
- return fprop->defaultvalue;
- }
+ return fprop->defaultvalue;
}
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
@@ -3389,15 +3379,13 @@ int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
#endif
return idprop->len - 1;
}
- else if (sprop->length) {
+ if (sprop->length) {
return sprop->length(ptr);
}
- else if (sprop->length_ex) {
+ if (sprop->length_ex) {
return sprop->length_ex(ptr, prop);
}
- else {
- return strlen(sprop->defaultvalue);
- }
+ return strlen(sprop->defaultvalue);
}
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
@@ -3555,12 +3543,10 @@ int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
if (eprop->get) {
return eprop->get(ptr);
}
- else if (eprop->get_ex) {
+ if (eprop->get_ex) {
return eprop->get_ex(ptr, prop);
}
- else {
- return eprop->defaultvalue;
- }
+ return eprop->defaultvalue;
}
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
@@ -3671,18 +3657,16 @@ PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
}
return rna_pointer_inherit_refine(ptr, pprop->type, idprop);
}
- else if (pprop->get) {
+ if (pprop->get) {
return pprop->get(ptr);
}
- else if (prop->flag & PROP_IDPROPERTY) {
+ if (prop->flag & PROP_IDPROPERTY) {
/* XXX temporary hack to add it automatically, reading should
* never do any write ops, to ensure thread safety etc .. */
RNA_property_pointer_add(ptr, prop);
return RNA_property_pointer_get(ptr, prop);
}
- else {
- return PointerRNA_NULL;
- }
+ return PointerRNA_NULL;
}
void RNA_property_pointer_set(PointerRNA *ptr,
@@ -3924,18 +3908,16 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
if (cprop->length) {
return cprop->length(ptr);
}
- else {
- CollectionPropertyIterator iter;
- int length = 0;
-
- RNA_property_collection_begin(ptr, prop, &iter);
- for (; iter.valid; RNA_property_collection_next(&iter)) {
- length++;
- }
- RNA_property_collection_end(&iter);
+ CollectionPropertyIterator iter;
+ int length = 0;
- return length;
+ RNA_property_collection_begin(ptr, prop, &iter);
+ for (; iter.valid; RNA_property_collection_next(&iter)) {
+ length++;
}
+ RNA_property_collection_end(&iter);
+
+ return length;
}
/* This helper checks whether given collection property itself is editable (we only currently
@@ -5775,21 +5757,19 @@ static char *rna_idp_path(PointerRNA *ptr,
path = rna_idp_path_create(&link);
break;
}
- else {
- int j;
- link.name = iter->name;
- for (j = 0; j < iter->len; j++, array++) {
- PointerRNA child_ptr;
- if (RNA_property_collection_lookup_int(ptr, prop, j, &child_ptr)) {
- link.index = j;
- if ((path = rna_idp_path(&child_ptr, array, needle, &link))) {
- break;
- }
+ int j;
+ link.name = iter->name;
+ for (j = 0; j < iter->len; j++, array++) {
+ PointerRNA child_ptr;
+ if (RNA_property_collection_lookup_int(ptr, prop, j, &child_ptr)) {
+ link.index = j;
+ if ((path = rna_idp_path(&child_ptr, array, needle, &link))) {
+ break;
}
}
- if (path) {
- break;
- }
+ }
+ if (path) {
+ break;
}
}
}
@@ -6788,9 +6768,7 @@ static char *rna_pointer_as_string__bldata(Main *bmain, PointerRNA *ptr)
if (RNA_struct_is_ID(ptr->type)) {
return RNA_path_full_ID_py(bmain, ptr->owner_id);
}
- else {
- return RNA_path_full_struct_py(bmain, ptr);
- }
+ return RNA_path_full_struct_py(bmain, ptr);
}
char *RNA_pointer_as_string(bContext *C,
@@ -6805,9 +6783,7 @@ char *RNA_pointer_as_string(bContext *C,
if ((prop = rna_idproperty_check(&prop_ptr, ptr)) && prop->type != IDP_ID) {
return RNA_pointer_as_string_id(C, ptr_prop);
}
- else {
- return rna_pointer_as_string__bldata(CTX_data_main(C), ptr_prop);
- }
+ return rna_pointer_as_string__bldata(CTX_data_main(C), ptr_prop);
}
/* context can be NULL */
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c
index d367bc663f1..4bbbf5f01da 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -211,7 +211,7 @@ bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACo
if (ptr_a == NULL || ptr_b == NULL) {
return false;
}
- else if (ptr_a->type != ptr_b->type) {
+ if (ptr_a->type != ptr_b->type) {
return false;
}
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index b298d49fad5..b437e60ecf9 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -513,7 +513,7 @@ static int rna_find_sdna_member(SDNA *sdna,
return 1;
}
- else if (cmp == 3) {
+ if (cmp == 3) {
smember->type = "";
smember->name = dnaname;
smember->offset = *offset;
@@ -2199,15 +2199,13 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop,
dp->dnaoffset = smember.offset;
return dp;
}
- else {
- CLOG_ERROR(&LOG,
- "\"%s.%s\" (identifier \"%s\") not found. Struct must be in DNA.",
- structname,
- propname,
- prop->identifier);
- DefRNA.error = true;
- return NULL;
- }
+ CLOG_ERROR(&LOG,
+ "\"%s.%s\" (identifier \"%s\") not found. Struct must be in DNA.",
+ structname,
+ propname,
+ prop->identifier);
+ DefRNA.error = true;
+ return NULL;
}
if (smember.arraylength > 1) {
@@ -4363,9 +4361,8 @@ int rna_parameter_size(PropertyRNA *parm)
}
return sizeof(PointerRNA *);
}
- else {
- return sizeof(void *);
- }
+ return sizeof(void *);
+
#endif
}
case PROP_COLLECTION:
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 1882fce3f54..2ffb9612486 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -956,8 +956,7 @@ static void rna_SequenceProxy_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_proxy(ed, ptr->data);
-
- BKE_sequence_invalidate_cache_raw(scene, seq);
+ BKE_sequence_invalidate_cache_preprocessed(scene, seq);
}
/* do_versions? */
@@ -1513,12 +1512,14 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "storage", SEQ_STORAGE_PROXY_CUSTOM_DIR);
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
- RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+ RNA_def_property_update(
+ prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "storage", SEQ_STORAGE_PROXY_CUSTOM_FILE);
RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from");
- RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+ RNA_def_property_update(
+ prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static void rna_def_color_balance(BlenderRNA *brna)
@@ -2182,7 +2183,8 @@ static void rna_def_proxy(StructRNA *srna)
RNA_def_property_ui_text(
prop, "Use Proxy / Timecode", "Use a preview proxy and/or time-code index for this strip");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
- RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+ RNA_def_property_update(
+ prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
@@ -2865,6 +2867,11 @@ static void rna_def_text(StructRNA *srna)
RNA_def_property_ui_text(prop, "Shadow Color", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+ prop = RNA_def_property(srna, "box_color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "box_color");
+ RNA_def_property_ui_text(prop, "Box Color", "");
+ RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+
prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "Location of the text");
@@ -2879,6 +2886,14 @@ static void rna_def_text(StructRNA *srna)
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+ prop = RNA_def_property(srna, "box_margin", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "box_margin");
+ RNA_def_property_ui_text(prop, "Box Margin", "Box margin as factor of image width");
+ RNA_def_property_range(prop, 0, 1.0);
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
+ RNA_def_property_float_default(prop, 0.01f);
+ RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+
prop = RNA_def_property(srna, "align_x", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "align");
RNA_def_property_enum_items(prop, text_align_x_items);
@@ -2901,6 +2916,11 @@ static void rna_def_text(StructRNA *srna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TEXT_SHADOW);
RNA_def_property_ui_text(prop, "Shadow", "Display shadow behind text");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
+
+ prop = RNA_def_property(srna, "use_box", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TEXT_BOX);
+ RNA_def_property_ui_text(prop, "Shadow", "Display colored box behind text");
+ RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
}
static void rna_def_color_mix(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index a32a2658723..2b6dc7fdf7f 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -5140,15 +5140,6 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
"(Action and Shape Key Editors only)");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
- prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWGCOLORS);
- RNA_def_property_ui_text(
- prop,
- "Show Group Colors",
- "Display groups and channels with colors matching their corresponding groups "
- "(pose bones only currently)");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
-
prop = RNA_def_property(srna, "show_interpolation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SHOW_INTERPOLATION);
RNA_def_property_ui_text(prop,
@@ -5316,14 +5307,6 @@ static void rna_def_space_graph(BlenderRNA *brna)
"(disable for better performance)");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
- prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWGCOLORS);
- RNA_def_property_ui_text(
- prop,
- "Show Group Colors",
- "Display groups and channels with colors matching their corresponding groups");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
-
prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SHOW_MARKERS);
RNA_def_property_ui_text(
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 932aa260bd5..2ae084d5a5d 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -409,6 +409,15 @@ static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value)
}
}
+static void rna_userdef_anim_update(Main *UNUSED(bmain),
+ Scene *UNUSED(scene),
+ PointerRNA *UNUSED(ptr))
+{
+ WM_main_add_notifier(NC_SPACE | ND_SPACE_GRAPH, NULL);
+ WM_main_add_notifier(NC_SPACE | ND_SPACE_DOPESHEET, NULL);
+ USERDEF_TAG_DIRTY;
+}
+
static void rna_userdef_tablet_api_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *UNUSED(ptr))
@@ -4994,6 +5003,15 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
"Color for newly added transformation F-Curves (Location, Rotation, Scale) "
"and also Color is based on the transform axis");
+ prop = RNA_def_property(srna, "use_anim_channel_group_colors", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "animation_flag", USER_ANIM_SHOW_CHANNEL_GROUP_COLORS);
+ RNA_def_property_ui_text(
+ prop,
+ "Channel Group Colors",
+ "Use animation channel group colors; generally this is used to show bone group colors");
+ RNA_def_property_boolean_default(prop, true);
+ RNA_def_property_update(prop, 0, "rna_userdef_anim_update");
+
prop = RNA_def_property(srna, "fcurve_new_auto_smoothing", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_enum_fcurve_auto_smoothing_items);
RNA_def_property_enum_sdna(prop, NULL, "auto_smoothing_new");