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:
authorMatt Ebb <matt@mke3.net>2010-01-27 03:22:29 +0300
committerMatt Ebb <matt@mke3.net>2010-01-27 03:22:29 +0300
commit0bb36e9ced06b04b961300b21211f456c7035bcf (patch)
tree9e38b0b5e9b84a22a7a03c5cad4139106168685c /source/blender/editors/interface/interface_templates.c
parentebafb7e484fa45aed0f4be75cfb5d570d7d43f81 (diff)
Fixes to Color Balance node:
* The Lift/Gamma/Gain formula previously was incorrect, fixed this and removed conversions - now the RNA values are the same as what goes into the formula. * Because of this, added the ability for the Value slider to map to a wider range than 0.0-1.0. The black/white gradient remains the same, in this case just indicating darker/brighter rather than absolute colour values. Also added ability for color wheels to be locked at full brightness (useful for this case, where the color value itself is dark). * Added an alternate formula - offset/power/slope (asc-cdl). This fits the standard Color Decision List formula, here for compatibility with other systems, though default Lift/Gamma/Gain is easier to use and gives nicer results.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 264bc724bce..44f653669f2 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1965,26 +1965,29 @@ void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, char *propname, i
#define WHEEL_SIZE 100
-void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, char *propname, int value_slider)
+void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, char *propname, int value_slider, int lock)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
uiBlock *block= uiLayoutGetBlock(layout);
uiLayout *col, *row;
+ float softmin, softmax, step, precision;
if (!prop) {
printf("uiTemplateColorWheel: property not found: %s\n", propname);
return;
}
+ RNA_property_float_ui_range(ptr, prop, &softmin, &softmax, &step, &precision);
+
col = uiLayoutColumn(layout, 0);
row= uiLayoutRow(col, 1);
- uiDefButR(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, propname, -1, 0.0, 0.0, 0, 0, "");
+ uiDefButR(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, propname, -1, 0.0, 0.0, 0, lock, "");
uiItemS(row);
if (value_slider)
- uiDefButR(block, HSVCUBE, 0, "", WHEEL_SIZE+6, 0, 14, WHEEL_SIZE, ptr, propname, -1, 0.0, 0.0, 9, 0, "");
+ uiDefButR(block, HSVCUBE, 0, "", WHEEL_SIZE+6, 0, 14, WHEEL_SIZE, ptr, propname, -1, softmin, softmax, 9, 0, "");
/* maybe a switch for this?
row= uiLayoutRow(col, 0);