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:
authorAntonio Vazquez <blendergit@gmail.com>2021-05-26 13:43:03 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-05-26 13:43:03 +0300
commit8a6604f253e22bbade3dcf60b9a1c437ace44151 (patch)
treefee875d0a0b09fbe0df52aa83094159144048205 /source/blender/makesrna/intern/rna_key.c
parentedf1b833674a6e54df7a16c14f0c6193fbbb482e (diff)
parentafec66c024dc2b75447537d45406c06342ec201e (diff)
Merge branch 'master' into temp-gpencil-maskingtemp-gpencil-masking
Conflicts: source/blender/blenloader/intern/versioning_300.c
Diffstat (limited to 'source/blender/makesrna/intern/rna_key.c')
-rw-r--r--source/blender/makesrna/intern/rna_key.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 3b9fc970072..a48727526c9 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -699,6 +699,16 @@ static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *p
}
}
+static void rna_ShapeKey_update_minmax(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ KeyBlock *data = (KeyBlock *)ptr->data;
+ if (IN_RANGE_INCL(data->curval, data->slidermin, data->slidermax)) {
+ return;
+ }
+ CLAMP(data->curval, data->slidermin, data->slidermax);
+ rna_Key_update_data(bmain, scene, ptr);
+}
+
static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point)
{
KeyBlock *kb;
@@ -955,6 +965,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
RNA_def_property_float_funcs(
prop, NULL, "rna_ShapeKey_slider_min_set", "rna_ShapeKey_slider_min_range");
RNA_def_property_ui_text(prop, "Slider Min", "Minimum for slider");
+ RNA_def_property_update(prop, 0, "rna_ShapeKey_update_minmax");
prop = RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "slidermax");
@@ -963,6 +974,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
RNA_def_property_float_funcs(
prop, NULL, "rna_ShapeKey_slider_max_set", "rna_ShapeKey_slider_max_range");
RNA_def_property_ui_text(prop, "Slider Max", "Maximum for slider");
+ RNA_def_property_update(prop, 0, "rna_ShapeKey_update_minmax");
prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "data", "totelem");