diff options
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index b60764c410d..a02eeaa1502 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -250,9 +250,19 @@ static void node_buts_texture(uiLayout *layout, bContext *UNUSED(C), PointerRNA } } -static void node_buts_map_range(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_shader_buts_clamp(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { - uiItemR(layout, ptr, "clamp", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "clamp_type", 0, "", ICON_NONE); +} + +static void node_shader_buts_map_range(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "interpolation_type", 0, "", ICON_NONE); + if (!ELEM(RNA_enum_get(ptr, "interpolation_type"), + NODE_MAP_RANGE_SMOOTHSTEP, + NODE_MAP_RANGE_SMOOTHERSTEP)) { + uiItemR(layout, ptr, "clamp", 0, NULL, ICON_NONE); + } } static void node_buts_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) @@ -1172,8 +1182,11 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_VALTORGB: ntype->draw_buttons = node_buts_colorramp; break; + case SH_NODE_CLAMP: + ntype->draw_buttons = node_shader_buts_clamp; + break; case SH_NODE_MAP_RANGE: - ntype->draw_buttons = node_buts_map_range; + ntype->draw_buttons = node_shader_buts_map_range; break; case SH_NODE_MATH: ntype->draw_buttons = node_buts_math; |