From ee5c2f6ead37eedfe2f45e6a53c856078bf92f5f Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Sat, 11 Jul 2020 20:41:21 +0200 Subject: GPencil: Replace "ShaderFX" with "Shader Effects" in RNA prop text --- source/blender/makesrna/intern/rna_scene.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index d141e6f3b19..9b98be61cbf 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -6463,7 +6463,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop = RNA_def_property(srna, "simplify_gpencil_shader_fx", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_FX); - RNA_def_property_ui_text(prop, "ShadersFX", "Display Shader FX"); + RNA_def_property_ui_text(prop, "Shaders Effects", "Display Shader Effects"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); prop = RNA_def_property(srna, "simplify_gpencil_tint", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3 From 474dcbcf126a308ea46543fcd914aa4bebf30a49 Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Mon, 13 Jul 2020 01:39:11 +0200 Subject: Cycles: Remove limits on the Sky texture's sun rotation For animation/driver purposes, being able to go outside of the 0-360 range makes things easier. Differential Revision: https://developer.blender.org/D8091 --- source/blender/makesrna/intern/rna_nodetree.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 86a270ec09d..2440b16aeb8 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -4461,7 +4461,6 @@ static void def_sh_tex_sky(StructRNA *srna) prop = RNA_def_property(srna, "sun_rotation", PROP_FLOAT, PROP_ANGLE); RNA_def_property_ui_text(prop, "Sun Rotation", "Rotation of sun around zenith"); - RNA_def_property_range(prop, 0.0f, 2.0f * M_PI); RNA_def_property_float_default(prop, 0.0f); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); -- cgit v1.2.3 From 77cd8182f865022320d0e48b31b599bad033dab5 Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Mon, 13 Jul 2020 01:40:47 +0200 Subject: Cycles: Remove Vector input on Sky texture when using the included sun When using the sun, we need to sun sampling logic to avoid excessive sampling map resolution, but that logic assumes that the Vector input comes from the view direction. That is the case in the vast majority of cases anyways, so the easiest solution is to just remove the input for that case. Differential Revision: https://developer.blender.org/D8091 --- source/blender/makesrna/intern/rna_nodetree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 2440b16aeb8..0658b2f048a 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -4421,7 +4421,7 @@ static void def_sh_tex_sky(StructRNA *srna) RNA_def_property_enum_sdna(prop, NULL, "sky_model"); RNA_def_property_enum_items(prop, prop_sky_type); RNA_def_property_ui_text(prop, "Sky Type", "Which sky model should be used"); - RNA_def_property_update(prop, 0, "rna_Node_update"); + RNA_def_property_update(prop, 0, "rna_ShaderNode_socket_update"); prop = RNA_def_property(srna, "sun_direction", PROP_FLOAT, PROP_DIRECTION); RNA_def_property_ui_text(prop, "Sun Direction", "Direction from where the sun is shining"); @@ -4445,7 +4445,7 @@ static void def_sh_tex_sky(StructRNA *srna) RNA_def_property_ui_text(prop, "Sun Disc", "Include the sun itself in the output"); RNA_def_property_boolean_sdna(prop, NULL, "sun_disc", 1); RNA_def_property_boolean_default(prop, true); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, 0, "rna_ShaderNode_socket_update"); prop = RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_ANGLE); RNA_def_property_ui_text(prop, "Sun Size", "Size of sun disc (angular diameter)"); -- cgit v1.2.3 From 41e6f9bd437cb5f23dd6a8ad41c6142b0520f65d Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Mon, 13 Jul 2020 01:49:25 +0200 Subject: Cycles: Add control for sun intensity in Sky Texture and change altitude to km Differential Revision: https://developer.blender.org/D8091 --- source/blender/makesrna/intern/rna_nodetree.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 0658b2f048a..332108facb3 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -4453,6 +4453,12 @@ static void def_sh_tex_sky(StructRNA *srna) RNA_def_property_float_default(prop, DEG2RADF(0.545)); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + prop = RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Sun Intensity", "Strength of sun"); + RNA_def_property_range(prop, 0.0f, 1000.0f); + RNA_def_property_float_default(prop, 1.0f); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + prop = RNA_def_property(srna, "sun_elevation", PROP_FLOAT, PROP_ANGLE); RNA_def_property_ui_text(prop, "Sun Elevation", "Angle between sun and horizon"); RNA_def_property_range(prop, -M_PI_2, M_PI_2); @@ -4464,10 +4470,10 @@ static void def_sh_tex_sky(StructRNA *srna) RNA_def_property_float_default(prop, 0.0f); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "altitude", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Altitude", "Altitude height from sea level in meters"); - RNA_def_property_range(prop, 0, 60000); - RNA_def_property_int_default(prop, 0); + prop = RNA_def_property(srna, "altitude", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Altitude", "Height from sea level in km"); + RNA_def_property_range(prop, 0.0f, 60.0f); + RNA_def_property_float_default(prop, 0.0f); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "air_density", PROP_FLOAT, PROP_FACTOR); -- cgit v1.2.3 From 725973485a909c2b732c58bd49d06a75edd52f7e Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 13 Jul 2020 11:27:09 +0200 Subject: Clang Tidy: enable readability-non-const-parameter warning Clang Tidy reported a couple of false positives. I disabled those `NOLINTNEXTLINE`. Differential Revision: https://developer.blender.org/D8199 --- source/blender/makesrna/intern/rna_access_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_access_internal.h b/source/blender/makesrna/intern/rna_access_internal.h index ecc9386ca77..7d8fff21862 100644 --- a/source/blender/makesrna/intern/rna_access_internal.h +++ b/source/blender/makesrna/intern/rna_access_internal.h @@ -30,8 +30,8 @@ struct PropertyRNAOrID; PropertyRNA *rna_ensure_property(PropertyRNA *prop); void rna_property_rna_or_id_get(PropertyRNA *prop, - PointerRNA *ptr, - PropertyRNAOrID *r_prop_rna_or_id); + PointerRNA *ptr, + PropertyRNAOrID *r_prop_rna_or_id); void rna_idproperty_touch(struct IDProperty *idprop); struct IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name); -- cgit v1.2.3 From f8afbb76571fa816a1d869240bdca595b97da846 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 13 Jul 2020 12:47:49 +0200 Subject: RNA property management: tweak to 'is set' information. Only consider a full IDProperty as set if it actually exists in given PointerRNA data. --- source/blender/makesrna/intern/rna_access.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 8bf715f93c1..793552c5c34 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -560,7 +560,10 @@ static PropertyRNA *arraytypemap[IDP_NUMTYPES] = { /* This function initializes a PropertyRNAOrID with all required info, from a given PropertyRNA * and PointerRNA data. It deals properly with the three cases (static RNA, runtime RNA, and - * IDProperty). */ + * IDProperty). + * WARNING: given `ptr` PointerRNA is assumed to be a valid data one here, calling code is + * responsible to ensure that. + */ void rna_property_rna_or_id_get(PropertyRNA *prop, PointerRNA *ptr, PropertyRNAOrID *r_prop_rna_or_id) @@ -617,8 +620,8 @@ void rna_property_rna_or_id_get(PropertyRNA *prop, r_prop_rna_or_id->idprop = idprop_evaluated; r_prop_rna_or_id->is_idprop = true; - /* Full IDProperties are always set. */ - r_prop_rna_or_id->is_set = true; + /* Full IDProperties are always set, if it exists. */ + r_prop_rna_or_id->is_set = (idprop_evaluated != NULL); r_prop_rna_or_id->identifier = idprop->name; if (idprop->type == IDP_ARRAY) { -- cgit v1.2.3 From 976a0ff691040fee4633910b9ab6f898d406405a Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 13 Jul 2020 12:48:56 +0200 Subject: RNA code cleanup: Fix wrong usages of `rna_idproperty_check()`. This function is more expansive than the simpler `rna_ensure_property()` one, and should only be used when IDProperty data is actually needed. If one only needs to ensure it has a valid PropertyRNA pointer, `rna_ensure_property()` is much more efficient. Also add compiler warnings when results of those functions are unused, this should never be the case. --- .../blender/makesrna/intern/rna_access_internal.h | 1 - source/blender/makesrna/intern/rna_internal.h | 8 ++- source/blender/makesrna/intern/rna_rna.c | 84 +++++++++++----------- 3 files changed, 48 insertions(+), 45 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_access_internal.h b/source/blender/makesrna/intern/rna_access_internal.h index 7d8fff21862..a5b554ec7a6 100644 --- a/source/blender/makesrna/intern/rna_access_internal.h +++ b/source/blender/makesrna/intern/rna_access_internal.h @@ -28,7 +28,6 @@ struct IDProperty; struct PropertyRNAOrID; -PropertyRNA *rna_ensure_property(PropertyRNA *prop); void rna_property_rna_or_id_get(PropertyRNA *prop, PointerRNA *ptr, PropertyRNAOrID *r_prop_rna_or_id); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 8e6a360f2c9..a8085c00cb3 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -23,6 +23,8 @@ #include "BLI_utildefines.h" +#include "BLI_compiler_attrs.h" + #include "rna_internal_types.h" #include "UI_resources.h" @@ -478,9 +480,11 @@ extern StructRNA RNA_PropertyGroupItem; extern StructRNA RNA_PropertyGroup; #endif -struct IDProperty *rna_idproperty_check(struct PropertyRNA **prop, struct PointerRNA *ptr); +struct IDProperty *rna_idproperty_check(struct PropertyRNA **prop, + struct PointerRNA *ptr) ATTR_WARN_UNUSED_RESULT; struct PropertyRNA *rna_ensure_property_realdata(struct PropertyRNA **prop, - struct PointerRNA *ptr); + struct PointerRNA *ptr) ATTR_WARN_UNUSED_RESULT; +struct PropertyRNA *rna_ensure_property(struct PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT; /* Override default callbacks. */ /* Default override callbacks for all types. */ diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 39949538726..f9f6defb2f1 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -479,7 +479,7 @@ static StructRNA *rna_Property_refine(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); /* XXX ptr? */ + prop = rna_ensure_property(prop); switch (prop->type) { case PROP_BOOLEAN: @@ -504,90 +504,90 @@ static StructRNA *rna_Property_refine(PointerRNA *ptr) static void rna_Property_identifier_get(PointerRNA *ptr, char *value) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); strcpy(value, ((PropertyRNA *)prop)->identifier); } static int rna_Property_identifier_length(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return strlen(prop->identifier); } static void rna_Property_name_get(PointerRNA *ptr, char *value) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); strcpy(value, prop->name ? prop->name : ""); } static int rna_Property_name_length(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return prop->name ? strlen(prop->name) : 0; } static void rna_Property_description_get(PointerRNA *ptr, char *value) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); strcpy(value, prop->description ? prop->description : ""); } static int rna_Property_description_length(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return prop->description ? strlen(prop->description) : 0; } static void rna_Property_translation_context_get(PointerRNA *ptr, char *value) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); strcpy(value, prop->translation_context); } static int rna_Property_translation_context_length(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return strlen(prop->translation_context); } static int rna_Property_type_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return prop->type; } static int rna_Property_subtype_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return prop->subtype; } static PointerRNA rna_Property_srna_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return rna_pointer_inherit_refine(ptr, &RNA_Struct, prop->srna); } static int rna_Property_unit_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return RNA_SUBTYPE_UNIT(prop->subtype); } static int rna_Property_icon_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return prop->icon; } @@ -698,7 +698,7 @@ static const EnumPropertyItem *rna_Property_tags_itemf(bContext *UNUSED(C), static int rna_Property_array_length_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return prop->totarraylength; } @@ -706,7 +706,7 @@ static void rna_Property_array_dimensions_get(PointerRNA *ptr, int dimensions[RNA_MAX_ARRAY_DIMENSION]) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); if (prop->arraydimension > 1) { for (int i = RNA_MAX_ARRAY_DIMENSION; i--;) { @@ -740,14 +740,14 @@ static bool rna_Property_is_runtime_get(PointerRNA *ptr) static bool rna_BoolProperty_default_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((BoolPropertyRNA *)prop)->defaultvalue; } static int rna_IntProperty_default_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((IntPropertyRNA *)prop)->defaultvalue; } /* int/float/bool */ @@ -755,7 +755,7 @@ static int rna_NumberProperty_default_array_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); length[0] = prop->totarraylength; @@ -771,7 +771,7 @@ static bool rna_NumberProperty_is_array_get(PointerRNA *ptr) static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); if (prop->totarraylength > 0) { PointerRNA null_ptr = PointerRNA_NULL; RNA_property_int_get_default_array(&null_ptr, prop, values); @@ -781,7 +781,7 @@ static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values) static void rna_BoolProperty_default_array_get(PointerRNA *ptr, bool *values) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); if (prop->totarraylength > 0) { PointerRNA null_ptr = PointerRNA_NULL; RNA_property_boolean_get_default_array(&null_ptr, prop, values); @@ -791,7 +791,7 @@ static void rna_BoolProperty_default_array_get(PointerRNA *ptr, bool *values) static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); if (prop->totarraylength > 0) { PointerRNA null_ptr = PointerRNA_NULL; RNA_property_float_get_default_array(&null_ptr, prop, values); @@ -801,103 +801,103 @@ static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values) static int rna_IntProperty_hard_min_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((IntPropertyRNA *)prop)->hardmin; } static int rna_IntProperty_hard_max_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((IntPropertyRNA *)prop)->hardmax; } static int rna_IntProperty_soft_min_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((IntPropertyRNA *)prop)->softmin; } static int rna_IntProperty_soft_max_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((IntPropertyRNA *)prop)->softmax; } static int rna_IntProperty_step_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((IntPropertyRNA *)prop)->step; } static float rna_FloatProperty_default_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((FloatPropertyRNA *)prop)->defaultvalue; } static float rna_FloatProperty_hard_min_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((FloatPropertyRNA *)prop)->hardmin; } static float rna_FloatProperty_hard_max_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((FloatPropertyRNA *)prop)->hardmax; } static float rna_FloatProperty_soft_min_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((FloatPropertyRNA *)prop)->softmin; } static float rna_FloatProperty_soft_max_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((FloatPropertyRNA *)prop)->softmax; } static float rna_FloatProperty_step_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((FloatPropertyRNA *)prop)->step; } static int rna_FloatProperty_precision_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((FloatPropertyRNA *)prop)->precision; } static void rna_StringProperty_default_get(PointerRNA *ptr, char *value) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); strcpy(value, ((StringPropertyRNA *)prop)->defaultvalue); } static int rna_StringProperty_default_length(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return strlen(((StringPropertyRNA *)prop)->defaultvalue); } static int rna_StringProperty_max_length_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((StringPropertyRNA *)prop)->maxlength; } @@ -909,7 +909,7 @@ static const EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PropertyRNA *prop = (PropertyRNA *)ptr->data; EnumPropertyRNA *eprop; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); eprop = (EnumPropertyRNA *)prop; /* incompatible default attributes */ @@ -931,7 +931,7 @@ static const EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, static int rna_EnumProperty_default_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return ((EnumPropertyRNA *)prop)->defaultvalue; } @@ -950,7 +950,7 @@ static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, Point int totitem; bool free; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); /* eprop = (EnumPropertyRNA *)prop; */ RNA_property_enum_items_ex( @@ -1016,14 +1016,14 @@ static int rna_EnumPropertyItem_icon_get(PointerRNA *ptr) static PointerRNA rna_PointerProperty_fixed_type_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((PointerPropertyRNA *)prop)->type); } static PointerRNA rna_CollectionProperty_fixed_type_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - rna_idproperty_check(&prop, ptr); + prop = rna_ensure_property(prop); return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((CollectionPropertyRNA *)prop)->item_type); } -- cgit v1.2.3 From b9f565881e15f13f5f30b6aca9fc656b3f92b900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 13 Jul 2020 15:02:25 +0200 Subject: VSE: Python API, allow creation of VSE Movie strips with missing file It was already possible to create Sound and Image strips that reference non-existing files. Now it's also possible to create Movie strips referencing missing files via the Python API call `Sequences.new_movie()`. In this case, the duration of the strip will be set to 1 frame. Note that this commit does not change anything in the user interface. The Python API of the `MovieStrip` class is extended with a function `reload_if_needed()`. This function only performs disk I/O if the movie strip cannot produce frames, that is either when its filepath points to a non-existing file, or when the video sequence editor has not been shown yet (for example because it is in an inactive workspace). This allows for the following: ``` import bpy scene = bpy.context.scene vse = scene.sequence_editor_create() filepath = bpy.path.abspath('//demo.mkv') strip = vse.sequences.new_movie("movie", filepath, channel=2, frame_start=47, file_must_exist=False) strip.frame_final_end = 327 ``` This will create a new movie strip, even when `demo.mkv` does not exist. Once `demo.mkv` has appeared at the expected location, either `strip.reload_if_needed()` or `strip.filepath = strip.filepath` will load it. Differential Revision: https://developer.blender.org/D8257 Reviewed By: Sergey, ISS --- source/blender/makesrna/intern/rna_sequencer.c | 26 +++++++++++++++++ source/blender/makesrna/intern/rna_sequencer_api.c | 33 +++++++++------------- 2 files changed, 40 insertions(+), 19 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 7342879e9e6..de225e3c685 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -749,6 +749,25 @@ static IDProperty *rna_Sequence_idprops(PointerRNA *ptr, bool create) return seq->prop; } +static bool rna_MovieSequence_reload_if_needed(ID *scene_id, Sequence *seq, Main *bmain) +{ + Scene *scene = (Scene *)scene_id; + bool has_reloaded; + bool can_produce_frames; + + BKE_sequence_movie_reload_if_needed(bmain, scene, seq, &has_reloaded, &can_produce_frames); + + if (has_reloaded && can_produce_frames) { + BKE_sequence_calc(scene, seq); + BKE_sequence_invalidate_cache_raw(scene, seq); + + DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); + WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); + } + + return can_produce_frames; +} + static PointerRNA rna_MovieSequence_metadata_get(Sequence *seq) { if (seq == NULL || seq->anims.first == NULL) { @@ -2385,6 +2404,13 @@ static void rna_def_movie(BlenderRNA *brna) "rna_Sequence_filepath_set"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update"); + func = RNA_def_function(srna, "reload_if_needed", "rna_MovieSequence_reload_if_needed"); + RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); + /* return type */ + parm = RNA_def_boolean( + func, "can_produce_frames", 0, "True if the strip can produce frames, False otherwise", ""); + RNA_def_function_return(func, parm); + /* metadata */ func = RNA_def_function(srna, "metadata", "rna_MovieSequence_metadata_get"); RNA_def_function_ui_description(func, "Retrieve metadata of the movie file"); diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 0fb582c41fd..4157747455d 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -205,33 +205,28 @@ static Sequence *rna_Sequences_new_image(ID *id, return seq; } -static Sequence *rna_Sequences_new_movie(ID *id, - Editing *ed, - ReportList *reports, - const char *name, - const char *file, - int channel, - int frame_start) +static Sequence *rna_Sequences_new_movie( + ID *id, Editing *ed, const char *name, const char *file, int channel, int frame_start) { Scene *scene = (Scene *)id; Sequence *seq; StripAnim *sanim; - struct anim *an = openanim(file, IB_rect, 0, NULL); + seq = alloc_generic_sequence(ed, name, frame_start, channel, SEQ_TYPE_MOVIE, file); + struct anim *an = openanim(file, IB_rect, 0, NULL); if (an == NULL) { - BKE_report(reports, RPT_ERROR, "Sequences.new_movie: unable to open movie file"); - return NULL; + /* Without anim, the strip gets duration 0, which makes it impossible to select in the UI. */ + seq->len = 1; } + else { + sanim = MEM_mallocN(sizeof(StripAnim), "Strip Anim"); + BLI_addtail(&seq->anims, sanim); + sanim->anim = an; - seq = alloc_generic_sequence(ed, name, frame_start, channel, SEQ_TYPE_MOVIE, file); - - sanim = MEM_mallocN(sizeof(StripAnim), "Strip Anim"); - BLI_addtail(&seq->anims, sanim); - sanim->anim = an; - - seq->anim_preseek = IMB_anim_get_preseek(an); - seq->len = IMB_anim_get_duration(an, IMB_TC_RECORD_RUN); + seq->anim_preseek = IMB_anim_get_preseek(an); + seq->len = IMB_anim_get_duration(an, IMB_TC_RECORD_RUN); + } BKE_sequence_calc_disp(scene, seq); BKE_sequence_invalidate_cache_composite(scene, seq); @@ -667,7 +662,7 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_return(func, parm); func = RNA_def_function(srna, "new_movie", "rna_Sequences_new_movie"); - RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); + RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, "Add a new movie sequence"); parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); -- cgit v1.2.3 From 2be7a11e4331d7a16ab29c474624b81b66eeecd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 13 Jul 2020 15:26:00 +0200 Subject: Python API: new RNA property `Screen.is_scrubbing` This commit adds a new read-only boolean property `Screen.is_scrubbing`. The related property `Screen.is_animation_playing` is set to `True` in two situations: - Animation is actually playing (for example via the Play button in the timeline) - The user is scrubbing through time (in the timeline, dopesheet, graph editor, etc.) To distinguish between these two cases, the property `Screen.is_scrubbing` has been added. Concept approved by @brecht. --- source/blender/makesrna/intern/rna_screen.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index 20ae69dc031..ea6421c8d11 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -90,6 +90,12 @@ static bool rna_Screen_is_animation_playing_get(PointerRNA *UNUSED(ptr)) return wm ? (ED_screen_animation_playing(wm) != NULL) : 0; } +static bool rna_Screen_is_scrubbing_get(PointerRNA *ptr) +{ + bScreen *screen = (bScreen *)ptr->data; + return screen->scrubbing; +} + static int rna_region_alignment_get(PointerRNA *ptr) { ARegion *region = ptr->data; @@ -548,6 +554,12 @@ static void rna_def_screen(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL); RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active"); + prop = RNA_def_property(srna, "is_scrubbing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Screen_is_scrubbing_get", NULL); + RNA_def_property_ui_text( + prop, "User is Scrubbing", "True when the user is scrubbing through time"); + prop = RNA_def_property(srna, "is_temporary", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "temp", 1); -- cgit v1.2.3 From 3d587efef2872a4466432679bad0c8bc6cc0a335 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 13 Jul 2020 16:44:41 +0200 Subject: LibOverride: Cleanup: Remove option to disable library overrides. Code is mature enough now to not need this anymore, people who do not want to use liboverrides can just not create them. --- source/blender/makesrna/intern/rna_ID.c | 2 +- source/blender/makesrna/intern/rna_access_compare_override.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 46001f27fef..8d498ab569b 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -518,7 +518,7 @@ static ID *rna_ID_copy(ID *id, Main *bmain) static ID *rna_ID_override_create(ID *id, Main *bmain, bool remap_local_usages) { - if (!BKE_lib_override_library_is_enabled() || !ID_IS_OVERRIDABLE_LIBRARY(id)) { + if (!ID_IS_OVERRIDABLE_LIBRARY(id)) { return NULL; } diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index a89c8c4667d..1b846fd898c 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -1177,10 +1177,6 @@ eRNAOverrideStatus RNA_property_override_library_status(PointerRNA *ptr, { uint override_status = 0; - if (!BKE_lib_override_library_is_enabled()) { - return override_status; - } - if (!ptr || !prop || !ptr->owner_id || !ID_IS_OVERRIDE_LIBRARY(ptr->owner_id)) { return override_status; } -- cgit v1.2.3 From 2b5e21fe00e861e40339cf3b4c6927c46525d3f6 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Sat, 11 Jul 2020 00:19:45 +0200 Subject: Sculpt: Add extra deform types to Smear The smear brush was using the stroke direction to slide colors across the mesh surface (this is called drag in other sculpt tools). Similarly, other deformations can be included. The most common ones in image editing are pinch and expand, which can be used to sharpen transitions between colors. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8270 --- source/blender/makesrna/intern/rna_brush.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index b139e4609cd..b4703ab9aa2 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1997,6 +1997,13 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem brush_smear_deform_type_items[] = { + {BRUSH_SMEAR_DEFORM_DRAG, "DRAG", 0, "Drag", ""}, + {BRUSH_SMEAR_DEFORM_PINCH, "PINCH", 0, "Pinch", ""}, + {BRUSH_SMEAR_DEFORM_EXPAND, "EXPAND", 0, "Expand", ""}, + {0, NULL, 0, NULL, NULL}, + }; + srna = RNA_def_struct(brna, "Brush", "ID"); RNA_def_struct_ui_text( srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting"); @@ -2117,6 +2124,11 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "smear_deform_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, brush_smear_deform_type_items); + RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "pose_deform_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, brush_pose_deform_type_items); RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush"); -- cgit v1.2.3 From b818f6b55ff0cd13445917715591d8eb38130c82 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 13 Jul 2020 20:10:49 -0400 Subject: Fix T78902: Only check main modifier panel for expansion property Internally the "show_expanded" property stores the expansion for every subpanel, but for RNA we should only check the first bit of the flag that corresponds to the main panel. --- source/blender/makesrna/intern/rna_modifier.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 20648970bd1..eb1a09f9c76 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1688,6 +1688,17 @@ static void rna_Modifier_show_expanded_set(PointerRNA *ptr, bool value) } } +/** + * Only check the first bit of the expansion flag for the main panel's expansion, + * maintaining compatibility with older versions where there was only one expansion + * value. + */ +static bool rna_Modifier_show_expanded_get(PointerRNA *ptr) +{ + ModifierData *md = ptr->data; + return md->ui_expand_flag & (1 << 0); +} + #else /* NOTE: *MUST* return subdivision_type property. */ @@ -6959,7 +6970,8 @@ void RNA_def_modifier(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, NULL, "rna_Modifier_show_expanded_set"); + RNA_def_property_boolean_funcs( + prop, "rna_Modifier_show_expanded_get", "rna_Modifier_show_expanded_set"); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); RNA_def_property_boolean_sdna(prop, NULL, "ui_expand_flag", 0); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); -- cgit v1.2.3 From 0fb08b7cc49d6a589fde476fde145c3d22b8d15d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 14 Jul 2020 16:04:18 +1000 Subject: Cleanup: sort header, cmake paths --- source/blender/makesrna/intern/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 9c2ee00a900..c2f1e204073 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -69,6 +69,7 @@ set(DEFSRC rna_packedfile.c rna_palette.c rna_particle.c + rna_pointcloud.c rna_pose.c rna_render.c rna_rigidbody.c @@ -82,7 +83,6 @@ set(DEFSRC rna_sound.c rna_space.c rna_speaker.c - rna_pointcloud.c rna_test.c rna_text.c rna_texture.c -- cgit v1.2.3 From dbcc74f8010f685156cf6416454a772f66fb6dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastia=CC=81n=20Barschkis?= Date: Tue, 14 Jul 2020 18:11:28 +0200 Subject: Fix T77263: Mantaflow: Cache gets deleted at changing upres factor under Particles section. Moved fluid simulation reset to separate functions based on type. --- source/blender/makesrna/intern/rna_fluid.c | 59 +++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 13 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index ab0cc6def6f..3387958c2f6 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -161,7 +161,7 @@ static void rna_Fluid_flow_reset(Main *bmain, Scene *scene, PointerRNA *ptr) rna_Fluid_update(bmain, scene, ptr); } -static void rna_Fluid_domain_reset(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Fluid_domain_data_reset(Main *bmain, Scene *scene, PointerRNA *ptr) { # ifdef WITH_FLUID FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data; @@ -172,6 +172,39 @@ static void rna_Fluid_domain_reset(Main *bmain, Scene *scene, PointerRNA *ptr) rna_Fluid_update(bmain, scene, ptr); } +static void rna_Fluid_domain_noise_reset(Main *bmain, Scene *scene, PointerRNA *ptr) +{ +# ifdef WITH_FLUID + FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data; + BKE_fluid_modifier_reset(settings->fmd); +# endif + + rna_Fluid_noisecache_reset(bmain, scene, ptr); + rna_Fluid_update(bmain, scene, ptr); +} + +static void rna_Fluid_domain_mesh_reset(Main *bmain, Scene *scene, PointerRNA *ptr) +{ +# ifdef WITH_FLUID + FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data; + BKE_fluid_modifier_reset(settings->fmd); +# endif + + rna_Fluid_meshcache_reset(bmain, scene, ptr); + rna_Fluid_update(bmain, scene, ptr); +} + +static void rna_Fluid_domain_particles_reset(Main *bmain, Scene *scene, PointerRNA *ptr) +{ +# ifdef WITH_FLUID + FluidDomainSettings *settings = (FluidDomainSettings *)ptr->data; + BKE_fluid_modifier_reset(settings->fmd); +# endif + + rna_Fluid_particlescache_reset(bmain, scene, ptr); + rna_Fluid_update(bmain, scene, ptr); +} + static void rna_Fluid_reset_dependency(Main *bmain, Scene *scene, PointerRNA *ptr) { # ifdef WITH_FLUID @@ -232,7 +265,7 @@ static void rna_Fluid_flip_parts_update(Main *bmain, Scene *scene, PointerRNA *p if (fmd->domain->type != FLUID_DOMAIN_TYPE_LIQUID) { rna_Fluid_parts_delete(ptr, PART_FLUID_FLIP); fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FLIP; - rna_Fluid_domain_reset(bmain, scene, ptr); + rna_Fluid_domain_data_reset(bmain, scene, ptr); return; } @@ -1350,7 +1383,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Adaptive Domain", "Adapt simulation resolution and size to fluid"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset"); /* fluid domain options */ @@ -1364,7 +1397,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) "Resolution used for the fluid domain. Value corresponds to the longest domain side " "(resolution for other domain sides is calculated automatically)"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset"); prop = RNA_def_property(srna, "use_collision_border_front", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "border_collisions", FLUID_DOMAIN_BORDER_FRONT); @@ -1547,7 +1580,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) "The noise simulation is scaled up by this factor (compared to the " "base resolution of the domain)"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_noise_reset"); prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noise_type"); @@ -1555,7 +1588,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Noise Method", "Noise method which is used during the high-res simulation"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_noise_reset"); prop = RNA_def_property(srna, "use_noise", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", FLUID_DOMAIN_USE_NOISE); @@ -1569,7 +1602,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "simulation_method"); RNA_def_property_enum_items(prop, simulation_methods); RNA_def_property_ui_text(prop, "Simulation Method", "Change the underlying simulation method"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset"); prop = RNA_def_property(srna, "flip_ratio", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); @@ -1657,7 +1690,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Use Diffusion", "Enable fluid diffusion settings (e.g. viscosity, surface tension)"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset"); prop = RNA_def_property(srna, "surface_tension", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); @@ -1724,7 +1757,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) "resolution of the domain). For best meshing, it is recommended to " "adjust the mesh particle radius alongside this value"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_meshcache_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_mesh_reset"); prop = RNA_def_property(srna, "mesh_generator", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mesh_generator"); @@ -1924,7 +1957,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) "The particle simulation is scaled up by this factor (compared to the " "base resolution of the domain)"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_particles_reset"); prop = RNA_def_property(srna, "use_spray_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "particle_type", FLUID_DOMAIN_PARTICLE_SPRAY); @@ -2081,7 +2114,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, cache_types); RNA_def_property_enum_funcs(prop, NULL, "rna_Fluid_cachetype_set", NULL); RNA_def_property_ui_text(prop, "Type", "Change the cache type of the simulation"); - RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Fluid_domain_data_reset"); prop = RNA_def_property(srna, "cache_resumable", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", FLUID_DOMAIN_USE_RESUMABLE_CACHE); @@ -2158,7 +2191,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) "only needed if you plan to analyze the cache (e.g. view grids, velocity vectors, " "particles) in Mantaflow directly (outside of Blender) after baking the simulation"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset"); /* time options */ @@ -2655,7 +2688,7 @@ static void rna_def_fluid_effector_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_plane_init", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", FLUID_EFFECTOR_USE_PLANE_INIT); RNA_def_property_ui_text(prop, "Is Planar", "Treat this object as a planar, unclosed mesh"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_domain_data_reset"); prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vel_multi"); -- cgit v1.2.3