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:
authorJacques Lucke <jacques@blender.org>2021-08-19 19:19:15 +0300
committerJacques Lucke <jacques@blender.org>2021-08-19 19:19:15 +0300
commit215ce0fb57031760782f8615994f338ae60504fc (patch)
treedcb4cd8735504318881668e069b36c74587e1192
parent5154598845e383fb13d4d33be6bbc66f9fca8587 (diff)
fix
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_mixRgb.cc9
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);
}