diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-08 01:42:59 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-08 01:42:59 +0300 |
commit | 320a09c2329119b56fd56b99d625b3aea72e854e (patch) | |
tree | 9eac6fcefb06f6d202f25fa84152b2e22965b4cd | |
parent | 73b52e243061fc0bb28f8ca077ed6a0917eb44db (diff) |
* Use color wheel template for RGB node
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 1 | ||||
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_rgb.c | 2 | ||||
-rw-r--r-- | source/blender/nodes/intern/SHD_nodes/SHD_rgb.c | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index b22fb279f37..d2a3e1e4e1a 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1868,14 +1868,16 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, char *propname, int { PropertyRNA *prop= RNA_struct_find_property(ptr, propname); uiBlock *block= uiLayoutGetBlock(layout); - uiLayout *row; + uiLayout *col, *row; + uiBut *but; if (!prop) { printf("uiTemplateColorWheel: property not found: %s\n", propname); return; } - row= uiLayoutRow(layout, 1); + 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, ""); @@ -1884,6 +1886,13 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, char *propname, int if (value_slider) uiDefButR(block, HSVCUBE, 0, "", WHEEL_SIZE+6, 0, 14, WHEEL_SIZE, ptr, propname, -1, 0.0, 0.0, 4, 0, ""); + /* maybe a switch for this? + row= uiLayoutRow(col, 0); + if(ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA) && RNA_property_array_length(ptr, prop) == 4) { + but= uiDefAutoButR(block, ptr, prop, 3, "A:", 0, 0, 0, WHEEL_SIZE+20, UI_UNIT_Y); + } + */ + } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 4f6b43337db..afbe54da961 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -166,6 +166,7 @@ static void node_buts_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr) RNA_property_collection_lookup_int(ptr, prop, 0, &sockptr); col = uiLayoutColumn(layout, 0); + uiTemplateColorWheel(col, &sockptr, "default_value", 1); uiItemR(col, "", 0, &sockptr, "default_value", 0); } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c index ae2678dc5f0..496e432bebf 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c @@ -47,7 +47,7 @@ bNodeType cmp_node_rgb= { /* *next,*prev */ NULL, NULL, /* type code */ CMP_NODE_RGB, /* name */ "RGB", - /* width+range */ 100, 60, 140, + /* width+range */ 140, 80, 140, /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, /* input sock */ NULL, /* output sock */ cmp_node_rgb_out, diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c index 1aa1a2ffc33..1c18e006a74 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c @@ -54,7 +54,7 @@ bNodeType sh_node_rgb= { /* *next,*prev */ NULL, NULL, /* type code */ SH_NODE_RGB, /* name */ "RGB", - /* width+range */ 100, 60, 140, + /* width+range */ 140, 80, 140, /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS, /* input sock */ NULL, /* output sock */ sh_node_rgb_out, |