Compositor: Add stub implemenetation for CPU pixel nodes
This patch adds stub implementation for CPU pixel nodes in order to stop those nodes from crashing when used while also easing future development. Pull Request: https://projects.blender.org/blender/blender/pulls/129033
This commit is contained in:
@@ -674,6 +674,63 @@ inline auto SI1_SO2(const char *name,
|
||||
name, element_fn, exec_preset, TypeSequence<In1>());
|
||||
}
|
||||
|
||||
/** Build multi-function with 2 single-input and 2 single-output parameter. */
|
||||
template<typename In1,
|
||||
typename In2,
|
||||
typename Out1,
|
||||
typename Out2,
|
||||
typename ElementFn,
|
||||
typename ExecPreset = exec_presets::Materialized>
|
||||
inline auto SI2_SO2(const char *name,
|
||||
const ElementFn element_fn,
|
||||
const ExecPreset exec_preset = exec_presets::Materialized())
|
||||
{
|
||||
return detail::build_multi_function_with_n_inputs_two_outputs<Out1, Out2>(
|
||||
name, element_fn, exec_preset, TypeSequence<In1, In2>());
|
||||
}
|
||||
|
||||
/** Build multi-function with 1 single-input and 3 single output parameter. */
|
||||
template<typename In1,
|
||||
typename Out1,
|
||||
typename Out2,
|
||||
typename Out3,
|
||||
typename ElementFn,
|
||||
typename ExecPreset = exec_presets::Materialized>
|
||||
inline auto SI1_SO3(const char *name,
|
||||
const ElementFn element_fn,
|
||||
const ExecPreset exec_preset = exec_presets::Materialized())
|
||||
{
|
||||
constexpr auto param_tags = TypeSequence<ParamTag<ParamCategory::SingleInput, In1>,
|
||||
ParamTag<ParamCategory::SingleOutput, Out1>,
|
||||
ParamTag<ParamCategory::SingleOutput, Out2>,
|
||||
ParamTag<ParamCategory::SingleOutput, Out3>>();
|
||||
auto call_fn = detail::build_multi_function_call_from_element_fn(
|
||||
element_fn, exec_preset, param_tags);
|
||||
return detail::CustomMF(name, call_fn, param_tags);
|
||||
}
|
||||
|
||||
/** Build multi-function with 1 single-input and 4 single output parameter. */
|
||||
template<typename In1,
|
||||
typename Out1,
|
||||
typename Out2,
|
||||
typename Out3,
|
||||
typename Out4,
|
||||
typename ElementFn,
|
||||
typename ExecPreset = exec_presets::Materialized>
|
||||
inline auto SI1_SO4(const char *name,
|
||||
const ElementFn element_fn,
|
||||
const ExecPreset exec_preset = exec_presets::Materialized())
|
||||
{
|
||||
constexpr auto param_tags = TypeSequence<ParamTag<ParamCategory::SingleInput, In1>,
|
||||
ParamTag<ParamCategory::SingleOutput, Out1>,
|
||||
ParamTag<ParamCategory::SingleOutput, Out2>,
|
||||
ParamTag<ParamCategory::SingleOutput, Out3>,
|
||||
ParamTag<ParamCategory::SingleOutput, Out4>>();
|
||||
auto call_fn = detail::build_multi_function_call_from_element_fn(
|
||||
element_fn, exec_preset, param_tags);
|
||||
return detail::CustomMF(name, call_fn, param_tags);
|
||||
}
|
||||
|
||||
} // namespace blender::fn::multi_function::build
|
||||
|
||||
namespace blender::fn::multi_function {
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -98,6 +104,18 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new AlphaOverShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI3_SO<float, float4, float4, float4>(
|
||||
"Alpha Over",
|
||||
[](const float /*factor*/,
|
||||
const float4 & /*color*/,
|
||||
const float4 & /*over_color*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<1, 2>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_alpha_over_cc
|
||||
|
||||
void register_node_type_cmp_alphaover()
|
||||
@@ -113,6 +131,7 @@ void register_node_type_cmp_alphaover()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeTwoFloats", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <limits>
|
||||
|
||||
#include "BLI_math_color.h"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "RNA_access.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
@@ -171,6 +177,19 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new ChannelMatteShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI1_SO2<float4, float4, float>(
|
||||
"Channel Key",
|
||||
[](const float4 & /*color*/, float4 &output_color, float &matte) -> void {
|
||||
output_color = float4(0.0f);
|
||||
matte = 0.0f;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_channel_matte_cc
|
||||
|
||||
void register_node_type_cmp_channel_matte()
|
||||
@@ -187,6 +206,7 @@ void register_node_type_cmp_channel_matte()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "BLI_math_rotation.h"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
@@ -110,6 +115,22 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new ChromaMatteShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO2<float4, float4, float4, float>(
|
||||
"Chroma Key",
|
||||
[](const float4 & /*color*/,
|
||||
const float4 & /*key_color*/,
|
||||
float4 &output_color,
|
||||
float &matte) -> void {
|
||||
output_color = float4(0.0f);
|
||||
matte = 0.0f;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_chroma_matte_cc
|
||||
|
||||
void register_node_type_cmp_chroma_matte()
|
||||
@@ -126,6 +147,7 @@ void register_node_type_cmp_chroma_matte()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -108,6 +114,22 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new ColorMatteShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO2<float4, float4, float4, float>(
|
||||
"Color Key",
|
||||
[](const float4 & /*color*/,
|
||||
const float4 & /*key_color*/,
|
||||
float4 &output_color,
|
||||
float &matte) -> void {
|
||||
output_color = float4(0.0f);
|
||||
matte = 0.0f;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_color_matte_cc
|
||||
|
||||
void register_node_type_cmp_color_matte()
|
||||
@@ -124,6 +146,7 @@ void register_node_type_cmp_color_matte()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "RNA_access.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
@@ -186,6 +192,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new ColorSpillShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO<float4, float, float4>(
|
||||
"Color Spill",
|
||||
[](const float4 & /*color*/, const float /*factor*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<0>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_color_spill_cc
|
||||
|
||||
void register_node_type_cmp_color_spill()
|
||||
@@ -201,6 +217,7 @@ void register_node_type_cmp_color_spill()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeColorspill", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "RNA_access.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
@@ -262,6 +268,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new ColorBalanceShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO<float, float4, float4>(
|
||||
"Color Balance",
|
||||
[](const float /*factor*/, const float4 & /*color*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<1>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_colorbalance_cc
|
||||
|
||||
void register_node_type_cmp_colorbalance()
|
||||
@@ -279,6 +295,7 @@ void register_node_type_cmp_colorbalance()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeColorBalance", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "IMB_colormanagement.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
@@ -341,6 +347,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new ColorCorrectionShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO<float4, float, float4>(
|
||||
"Color Correction",
|
||||
[](const float4 & /*color*/, const float /*mask*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<0>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_colorcorrection_cc
|
||||
|
||||
void register_node_type_cmp_colorcorrection()
|
||||
@@ -358,6 +374,7 @@ void register_node_type_cmp_colorcorrection()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeColorCorrection", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
*/
|
||||
|
||||
#include "BLI_math_base.h"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "BKE_colortools.hh"
|
||||
|
||||
@@ -184,6 +189,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new VectorCurvesShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI1_SO<float4, float4>(
|
||||
"Vector Curves",
|
||||
[](const float4 & /*vector*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_vector_curves_cc
|
||||
|
||||
void register_node_type_cmp_curve_vec()
|
||||
@@ -199,6 +214,7 @@ void register_node_type_cmp_curve_vec()
|
||||
ntype.initfunc = file_ns::node_composit_init_curve_vec;
|
||||
blender::bke::node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
@@ -329,6 +345,19 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new RGBCurvesShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI4_SO<float, float4, float4, float4, float4>(
|
||||
"RGB Curves",
|
||||
[](const float /*factor*/,
|
||||
const float4 & /*color*/,
|
||||
const float4 & /*black*/,
|
||||
const float4 & /*white*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<1>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_rgb_curves_cc
|
||||
|
||||
void register_node_type_cmp_curve_rgb()
|
||||
@@ -343,6 +372,7 @@ void register_node_type_cmp_curve_rgb()
|
||||
ntype.initfunc = file_ns::node_composit_init_curve_rgb;
|
||||
blender::bke::node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -90,6 +96,20 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new DifferenceMatteShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO2<float4, float4, float4, float>(
|
||||
"Difference Key",
|
||||
[](const float4 & /*color1*/, const float4 & /*color2*/, float4 &output_color, float &matte)
|
||||
-> void {
|
||||
output_color = float4(0.0f);
|
||||
matte = 0.0f;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_diff_matte_cc
|
||||
|
||||
void register_node_type_cmp_diff_matte()
|
||||
@@ -106,6 +126,7 @@ void register_node_type_cmp_diff_matte()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -112,6 +118,22 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new DistanceMatteShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO2<float4, float4, float4, float>(
|
||||
"Distance Key",
|
||||
[](const float4 & /*color*/,
|
||||
const float4 & /*key_color*/,
|
||||
float4 &output_color,
|
||||
float &matte) -> void {
|
||||
output_color = float4(0.0f);
|
||||
matte = 0.0f;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_distance_matte_cc
|
||||
|
||||
void register_node_type_cmp_distance_matte()
|
||||
@@ -128,6 +150,7 @@ void register_node_type_cmp_distance_matte()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
@@ -45,6 +51,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new ExposureShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO<float4, float, float4>(
|
||||
"Exposure",
|
||||
[](const float4 & /*color*/, const float /*exposure*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<0>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_exposure_cc
|
||||
|
||||
void register_node_type_cmp_exposure()
|
||||
@@ -56,6 +72,7 @@ void register_node_type_cmp_exposure()
|
||||
cmp_node_type_base(&ntype, CMP_NODE_EXPOSURE, "Exposure", NODE_CLASS_OP_COLOR);
|
||||
ntype.declare = file_ns::cmp_node_exposure_declare;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
@@ -69,6 +75,20 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new HueSaturationValueShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI5_SO<float4, float, float, float, float, float4>(
|
||||
"Hue Saturation Value",
|
||||
[](const float4 & /*color*/,
|
||||
const float /*hue*/,
|
||||
const float /*saturation*/,
|
||||
const float /*value*/,
|
||||
const float /*factor*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<0>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_hue_sat_val_cc
|
||||
|
||||
void register_node_type_cmp_hue_sat()
|
||||
@@ -80,6 +100,7 @@ void register_node_type_cmp_hue_sat()
|
||||
cmp_node_type_base(&ntype, CMP_NODE_HUE_SAT, "Hue/Saturation/Value", NODE_CLASS_OP_COLOR);
|
||||
ntype.declare = file_ns::cmp_node_huesatval_declare;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "BKE_colortools.hh"
|
||||
|
||||
#include "GPU_material.hh"
|
||||
@@ -95,6 +101,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new HueCorrectShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO<float, float4, float4>(
|
||||
"Hue Correct",
|
||||
[](const float /*factor*/, const float4 & /*color*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<1>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_huecorrect_cc
|
||||
|
||||
void register_node_type_cmp_huecorrect()
|
||||
@@ -109,6 +125,7 @@ void register_node_type_cmp_huecorrect()
|
||||
ntype.initfunc = file_ns::node_composit_init_huecorrect;
|
||||
blender::bke::node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -86,6 +92,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new InvertShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO<float, float4, float4>(
|
||||
"Invert",
|
||||
[](const float /*factor*/, const float4 & /*color*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<1>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_invert_cc
|
||||
|
||||
void register_node_type_cmp_invert()
|
||||
@@ -99,6 +115,7 @@ void register_node_type_cmp_invert()
|
||||
ntype.draw_buttons = file_ns::node_composit_buts_invert;
|
||||
ntype.initfunc = file_ns::node_composit_init_invert;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "IMB_colormanagement.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
@@ -93,6 +99,19 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new LuminanceMatteShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI1_SO2<float4, float4, float>(
|
||||
"Luminance Key",
|
||||
[](const float4 & /*color*/, float4 &output_color, float &matte) -> void {
|
||||
output_color = float4(0.0f);
|
||||
matte = 0.0f;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_luma_matte_cc
|
||||
|
||||
void register_node_type_cmp_luma_matte()
|
||||
@@ -109,6 +128,7 @@ void register_node_type_cmp_luma_matte()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -89,6 +93,20 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new MapRangeShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI5_SO<float, float, float, float, float, float>(
|
||||
"Map Range",
|
||||
[](const float /*value*/,
|
||||
const float /*from_min*/,
|
||||
const float /*from_max*/,
|
||||
const float /*to_min*/,
|
||||
const float /*to_max*/) -> float { return 0.0f; },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<0>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_map_range_cc
|
||||
|
||||
void register_node_type_cmp_map_range()
|
||||
@@ -101,6 +119,7 @@ void register_node_type_cmp_map_range()
|
||||
ntype.declare = file_ns::cmp_node_map_range_declare;
|
||||
ntype.draw_buttons = file_ns::node_composit_buts_map_range;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "BKE_texture.h"
|
||||
|
||||
#include "RNA_access.hh"
|
||||
@@ -106,6 +110,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new MapValueShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI1_SO<float, float>(
|
||||
"Map Value",
|
||||
[](const float /*value*/) -> float { return 0.0f; },
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_map_value_cc
|
||||
|
||||
void register_node_type_cmp_map_value()
|
||||
@@ -121,6 +135,7 @@ void register_node_type_cmp_map_value()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
*/
|
||||
|
||||
#include "BLI_assert.h"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "DNA_material_types.h"
|
||||
|
||||
@@ -14,6 +17,7 @@
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
#include "NOD_socket_search_link.hh"
|
||||
|
||||
#include "RNA_enum_types.hh"
|
||||
@@ -169,6 +173,18 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new MixRGBShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI3_SO<float, float4, float4, float4>(
|
||||
"Mix RGB",
|
||||
[](const float /*factor*/, const float4 & /*color1*/, const float4 & /*color2*/) -> float4 {
|
||||
return float4(0.0f);
|
||||
},
|
||||
mf::build::exec_presets::SomeSpanOrSingle<1, 2>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_mixrgb_cc
|
||||
|
||||
void register_node_type_cmp_mix_rgb()
|
||||
@@ -183,6 +199,7 @@ void register_node_type_cmp_mix_rgb()
|
||||
ntype.labelfunc = node_blend_label;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.gather_link_search_ops = file_ns::node_gather_link_searches;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector.hh"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
@@ -49,6 +55,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new PosterizeShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO<float4, float, float4>(
|
||||
"Posterize",
|
||||
[](const float4 & /*color*/, const float /*steps*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::SomeSpanOrSingle<0>());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_posterize_cc
|
||||
|
||||
void register_node_type_cmp_posterize()
|
||||
@@ -60,6 +76,7 @@ void register_node_type_cmp_posterize()
|
||||
cmp_node_type_base(&ntype, CMP_NODE_POSTERIZE, "Posterize", NODE_CLASS_OP_COLOR);
|
||||
ntype.declare = file_ns::cmp_node_posterize_declare;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -62,6 +68,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new AlphaConvertShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI1_SO<float4, float4>(
|
||||
"Alpha Convert",
|
||||
[](const float4 & /*color*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_premulkey_cc
|
||||
|
||||
void register_node_type_cmp_premulkey()
|
||||
@@ -74,6 +90,7 @@ void register_node_type_cmp_premulkey()
|
||||
ntype.declare = file_ns::cmp_node_premulkey_declare;
|
||||
ntype.draw_buttons = file_ns::node_composit_buts_premulkey;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "BLI_assert.h"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "GPU_material.hh"
|
||||
|
||||
@@ -129,6 +134,21 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new SeparateColorShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI1_SO4<float4, float, float, float, float>(
|
||||
"Separate Color",
|
||||
[](const float4 & /*color*/, float &red, float &green, float &blue, float &alpha) -> void {
|
||||
red = 0.0f;
|
||||
green = 0.0f;
|
||||
blue = 0.0f;
|
||||
alpha = 0.0f;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_separate_color_cc
|
||||
|
||||
void register_node_type_cmp_separate_color()
|
||||
@@ -144,6 +164,7 @@ void register_node_type_cmp_separate_color()
|
||||
&ntype, "NodeCMPCombSepColor", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.updatefunc = file_ns::cmp_node_separate_color_update;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
@@ -235,6 +256,17 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new CombineColorShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI4_SO<float, float, float, float, float4>(
|
||||
"Combine Color",
|
||||
[](const float /*red*/, const float /*green*/, const float /*blue*/, const float /*alpha*/)
|
||||
-> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::Materialized());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_combine_color_cc
|
||||
|
||||
void register_node_type_cmp_combine_color()
|
||||
@@ -250,6 +282,7 @@ void register_node_type_cmp_combine_color()
|
||||
&ntype, "NodeCMPCombSepColor", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.updatefunc = file_ns::cmp_node_combine_color_update;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
@@ -44,6 +50,19 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new SeparateXYZShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
static auto function = mf::build::SI1_SO3<float4, float, float, float>(
|
||||
"Separate XYZ",
|
||||
[](const float4 &vector, float &x, float &y, float &z) -> void {
|
||||
x = vector.x;
|
||||
y = vector.y;
|
||||
z = vector.z;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_separate_xyz_cc
|
||||
|
||||
void register_node_type_cmp_separate_xyz()
|
||||
@@ -55,6 +74,7 @@ void register_node_type_cmp_separate_xyz()
|
||||
cmp_node_type_base(&ntype, CMP_NODE_SEPARATE_XYZ, "Separate XYZ", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_separate_xyz_declare;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
@@ -91,6 +111,15 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new CombineXYZShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
static auto function = mf::build::SI3_SO<float, float, float, float4>(
|
||||
"Combine XYZ",
|
||||
[](const float x, const float y, const float z) -> float4 { return float4(x, y, z, 0.0f); },
|
||||
mf::build::exec_presets::Materialized());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_combine_xyz_cc
|
||||
|
||||
void register_node_type_cmp_combine_xyz()
|
||||
@@ -102,6 +131,7 @@ void register_node_type_cmp_combine_xyz()
|
||||
cmp_node_type_base(&ntype, CMP_NODE_COMBINE_XYZ, "Combine XYZ", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_combine_xyz_declare;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -71,6 +77,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new SetAlphaShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI2_SO<float4, float, float4>(
|
||||
"Set Alpha",
|
||||
[](const float4 & /*color*/, const float /*alpha*/) -> float4 { return float4(0.0f); },
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_setalpha_cc
|
||||
|
||||
void register_node_type_cmp_setalpha()
|
||||
@@ -86,6 +102,7 @@ void register_node_type_cmp_setalpha()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "NodeSetAlpha", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
*/
|
||||
|
||||
#include "BLI_assert.h"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
|
||||
#include "FN_multi_function_builder.hh"
|
||||
|
||||
#include "NOD_multi_function.hh"
|
||||
|
||||
#include "IMB_colormanagement.hh"
|
||||
|
||||
@@ -126,6 +131,19 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new ColorRampShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI1_SO2<float, float4, float>(
|
||||
"Color Ramp",
|
||||
[](const float /*factor*/, float4 &color, float &alpha) -> void {
|
||||
color = float4(0.0f);
|
||||
alpha = 0.0f;
|
||||
},
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_color_ramp_cc
|
||||
|
||||
void register_node_type_cmp_valtorgb()
|
||||
@@ -141,6 +159,7 @@ void register_node_type_cmp_valtorgb()
|
||||
blender::bke::node_type_storage(
|
||||
&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
@@ -185,6 +204,16 @@ static ShaderNode *get_compositor_shader_node(DNode node)
|
||||
return new RGBToBWShaderNode(node);
|
||||
}
|
||||
|
||||
static void node_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
|
||||
{
|
||||
/* Not yet implemented. Return zero. */
|
||||
static auto function = mf::build::SI1_SO<float4, float>(
|
||||
"RGB to BW",
|
||||
[](const float4 & /*color*/) -> float { return 0.0f; },
|
||||
mf::build::exec_presets::AllSpanOrSingle());
|
||||
builder.set_matching_fn(function);
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::node_composite_rgb_to_bw_cc
|
||||
|
||||
void register_node_type_cmp_rgbtobw()
|
||||
@@ -197,6 +226,7 @@ void register_node_type_cmp_rgbtobw()
|
||||
ntype.declare = file_ns::cmp_node_rgbtobw_declare;
|
||||
blender::bke::node_type_size_preset(&ntype, blender::bke::eNodeSizePreset::Default);
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
ntype.build_multi_function = file_ns::node_build_multi_function;
|
||||
|
||||
blender::bke::node_register_type(&ntype);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user