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:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-07-07 13:08:14 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-07-07 13:08:14 +0300
commit00d476976e88052e8410916fca1d86d5f12529ca (patch)
tree37f1faabe6e77227e7e422e1b35481f9d6b99016
parentfee7f688c32eee152742dcda031675d42975e52f (diff)
Fix T50973: Directional blur node doesn't clamp value if using driver
The issue was caused by combination of following factors: - Blender Internal viewport render can not distinguish between which parts of main database changed, so it does full database re-sync when anything is tagged for an update. This way, if any NodeTree (including compositor) is changed, Blender Internal viewport is tagged for full render database update. - With old dependency graph, scene-level drivers are evaluated on every iteration of scene_update_tagged, even if nothing is tagged for an update. This causes compositor drivers be evaluated quite often. - Driver evaluation checks whether value was changed, and if so it tags corresponding ID type as updated (this is what was telling viewport to do render database update). This check was quite stupid: current property value was checked against the one coming from driver expression. This means, if driver value is outside of the hard limit range of the property, the property will always be considered updated. The fix is to compare current property value against clamped value from the driver.
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c13
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 bcc0d1aeacb..539901a59d5 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1519,7 +1519,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);
@@ -1536,15 +1537,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;
}
}