diff options
author | Charlie Jolly <charlie> | 2021-09-30 21:05:08 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2021-09-30 21:24:40 +0300 |
commit | be70827e6f62763d524f00652f61da6fc86e2714 (patch) | |
tree | 72a673c31ac82ea03a18d126bb17d70ad5955690 /source/blender/editors/space_node/drawnode.cc | |
parent | 827e30bd1512f6917307195ccc934b57623f0f8b (diff) |
Nodes: Add Float Curve for GN and Shader nodes.
Replacement for float curve in legacy Attribute Curve Map node.
Float Curve defaults to [0.0-1.0] range.
Reviewed By: JacquesLucke, brecht
Differential Revision: https://developer.blender.org/D12683
Diffstat (limited to 'source/blender/editors/space_node/drawnode.cc')
-rw-r--r-- | source/blender/editors/space_node/drawnode.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index b4a9b90434c..8d6d56fc383 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -164,6 +164,11 @@ static void node_buts_curvevec(uiLayout *layout, bContext *UNUSED(C), PointerRNA uiTemplateCurveMapping(layout, ptr, "mapping", 'v', false, false, false, false); } +static void node_buts_curvefloat(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiTemplateCurveMapping(layout, ptr, "mapping", 0, false, false, false, false); +} + #define SAMPLE_FLT_ISNONE FLT_MAX /* Bad bad, 2.5 will do better? ... no it won't! */ static float _sample_col[4] = {SAMPLE_FLT_ISNONE}; @@ -1183,6 +1188,9 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_CURVE_RGB: ntype->draw_buttons = node_buts_curvecol; break; + case SH_NODE_CURVE_FLOAT: + ntype->draw_buttons = node_buts_curvefloat; + break; case SH_NODE_MAPPING: ntype->draw_buttons = node_shader_buts_mapping; break; |