diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_mixRgb.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.cc b/source/blender/nodes/shader/nodes/node_shader_mixRgb.cc index 9770ae11c08..ade35a40366 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.cc +++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.cc @@ -174,6 +174,14 @@ class MixRGBFunction : public blender::fn::MultiFunction { } }; +static void sh_node_mix_rgb_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder) +{ + bNode &node = builder.node(); + bool clamp = node.custom2 & SHD_MIXRGB_CLAMP; + int mix_type = node.custom1; + builder.construct_and_set_matching_fn<MixRGBFunction>(clamp, mix_type); +} + void register_node_type_sh_mix_rgb(void) { static bNodeType ntype; @@ -183,6 +191,7 @@ void register_node_type_sh_mix_rgb(void) node_type_label(&ntype, node_blend_label); node_type_exec(&ntype, nullptr, nullptr, node_shader_exec_mix_rgb); node_type_gpu(&ntype, gpu_shader_mix_rgb); + ntype.build_multi_function = sh_node_mix_rgb_build_multi_function; nodeRegisterType(&ntype); } |