diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-07-08 02:02:11 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-07-08 02:02:11 +0300 |
commit | db28e2deb9d154ed50600542e37828867d0148e5 (patch) | |
tree | 279612479f5a0052d4a189af6e36b3dbff1e231c /source/blender/blenkernel/intern/anim_sys.c | |
parent | e960cecdf8d1cef32f8c42e633ad05a08a97972b (diff) | |
parent | 7dc3ad22873e08de11172757066bb2b3a27f7203 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/anim_sys.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 6475e5c8acd..3b3dff21206 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1521,7 +1521,8 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val } case PROP_INT: { - const int value_coerce = (int)value; + int value_coerce = (int)value; + RNA_property_int_clamp(ptr, prop, &value_coerce); if (array_index != -1) { if (RNA_property_int_get_index(ptr, prop, array_index) != value_coerce) { RNA_property_int_set_index(ptr, prop, array_index, value_coerce); @@ -1538,15 +1539,17 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val } case PROP_FLOAT: { + float value_coerce = value; + RNA_property_float_clamp(ptr, prop, &value_coerce); if (array_index != -1) { - if (RNA_property_float_get_index(ptr, prop, array_index) != value) { - RNA_property_float_set_index(ptr, prop, array_index, value); + if (RNA_property_float_get_index(ptr, prop, array_index) != value_coerce) { + RNA_property_float_set_index(ptr, prop, array_index, value_coerce); written = true; } } else { - if (RNA_property_float_get(ptr, prop) != value) { - RNA_property_float_set(ptr, prop, value); + if (RNA_property_float_get(ptr, prop) != value_coerce) { + RNA_property_float_set(ptr, prop, value_coerce); written = true; } } |