Compositor: Support structure type

This patch adds support for the experimental structure types currently
used bu Geometry Nodes. Pixel nodes were declared as function nodes,
which gives dynamic structures for all their sockets. Other nodes now
explicitly declared their inputs as dynamic if not single value, while
the compositor_expects_single_value marker was removed in favor of the
StructureType::Single type.

Pull Request: https://projects.blender.org/blender/blender/pulls/140910
This commit is contained in:
Omar Emara
2025-06-25 11:54:48 +02:00
committed by Omar Emara
parent 872c8fb189
commit 3b1d252431
80 changed files with 471 additions and 478 deletions

View File

@@ -518,9 +518,15 @@ class NodeTreeMainUpdater {
if (node_field_inferencing::update_field_inferencing(ntree)) {
result.interface_changed = true;
}
}
if (ELEM(ntree.type, NTREE_GEOMETRY, NTREE_COMPOSIT)) {
if (node_structure_type_inferencing::update_structure_type_interface(ntree)) {
result.interface_changed = true;
}
}
if (ntree.type == NTREE_GEOMETRY) {
this->update_from_field_inference(ntree);
if (node_tree_reference_lifetimes::analyse_reference_lifetimes(ntree)) {
result.interface_changed = true;
@@ -528,7 +534,13 @@ class NodeTreeMainUpdater {
if (nodes::gizmos::update_tree_gizmo_propagation(ntree)) {
result.interface_changed = true;
}
}
if (ELEM(ntree.type, NTREE_GEOMETRY, NTREE_COMPOSIT)) {
this->update_socket_shapes(ntree);
}
if (ntree.type == NTREE_GEOMETRY) {
this->update_eval_dependencies(ntree);
}
@@ -954,18 +966,25 @@ class NodeTreeMainUpdater {
}
}
else {
const Span<bke::FieldSocketState> field_states = ntree.runtime->field_states;
for (bNodeSocket *socket : ntree.all_sockets()) {
switch (field_states[socket->index_in_tree()]) {
case bke::FieldSocketState::RequiresSingle:
socket->display_shape = SOCK_DISPLAY_SHAPE_CIRCLE;
break;
case bke::FieldSocketState::CanBeField:
socket->display_shape = SOCK_DISPLAY_SHAPE_DIAMOND_DOT;
break;
case bke::FieldSocketState::IsField:
socket->display_shape = SOCK_DISPLAY_SHAPE_DIAMOND;
break;
if (ntree.type == NTREE_GEOMETRY) {
const Span<bke::FieldSocketState> field_states = ntree.runtime->field_states;
for (bNodeSocket *socket : ntree.all_sockets()) {
switch (field_states[socket->index_in_tree()]) {
case bke::FieldSocketState::RequiresSingle:
socket->display_shape = SOCK_DISPLAY_SHAPE_CIRCLE;
break;
case bke::FieldSocketState::CanBeField:
socket->display_shape = SOCK_DISPLAY_SHAPE_DIAMOND_DOT;
break;
case bke::FieldSocketState::IsField:
socket->display_shape = SOCK_DISPLAY_SHAPE_DIAMOND;
break;
}
}
}
else if (ntree.type == NTREE_COMPOSIT) {
for (bNodeSocket *socket : ntree.all_sockets()) {
socket->display_shape = SOCK_DISPLAY_SHAPE_CIRCLE;
}
}
}

View File

@@ -159,7 +159,8 @@ InputDescriptor input_descriptor_from_input_socket(const bNodeSocket *socket)
}
const SocketDeclaration *socket_declaration = node_declaration->inputs[socket->index()];
input_descriptor.domain_priority = get_domain_priority(socket, socket_declaration);
input_descriptor.expects_single_value = socket_declaration->compositor_expects_single_value();
input_descriptor.expects_single_value = socket_declaration->structure_type ==
StructureType::Single;
input_descriptor.realization_mode = static_cast<InputRealizationMode>(
socket_declaration->compositor_realization_mode());
input_descriptor.implicit_input = get_implicit_input(socket_declaration);

View File

@@ -1182,8 +1182,12 @@ static void node_group_make_insert_selected(const bContext &C,
if (group.type == NTREE_GEOMETRY) {
bke::node_field_inferencing::update_field_inferencing(group);
}
if (ELEM(group.type, NTREE_GEOMETRY, NTREE_COMPOSIT)) {
bke::node_structure_type_inferencing::update_structure_type_interface(group);
}
nodes::update_node_declaration_and_sockets(ntree, *gnode);
/* Add new links to inputs outside of the group. */

View File

@@ -237,10 +237,6 @@ class SocketDeclaration : public ItemDeclaration {
* See compositor::InputDescriptor for more information. */
int compositor_domain_priority_ = -1;
/** This input expects a single value and can't operate on non-single values. See
* compositor::InputDescriptor for more information. */
bool compositor_expects_single_value_ = false;
/** Utility method to make the socket available if there is a straightforward way to do so. */
std::function<void(bNode &)> make_available_fn_;
@@ -282,7 +278,6 @@ class SocketDeclaration : public ItemDeclaration {
const CompositorInputRealizationMode &compositor_realization_mode() const;
int compositor_domain_priority() const;
bool compositor_expects_single_value() const;
protected:
void set_common_flags(bNodeSocket &socket) const;
@@ -399,12 +394,6 @@ class BaseSocketDeclarationBuilder {
*/
BaseSocketDeclarationBuilder &compositor_domain_priority(int priority);
/**
* This input expects a single value and can't operate on non-single values. See
* compositor::InputDescriptor for more information.
*/
BaseSocketDeclarationBuilder &compositor_expects_single_value(bool value = true);
/**
* Pass a function that sets properties on the node required to make the corresponding socket
* available, if it is not available on the default state of the node. The function is allowed to

View File

@@ -25,6 +25,7 @@ namespace blender::nodes::node_composite_alpha_over_cc {
static void cmp_node_alphaover_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac")
.default_value(1.0f)
.min(0.0f)

View File

@@ -21,7 +21,7 @@ static void cmp_node_antialiasing_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Threshold")
.default_value(0.2f)
.subtype(PROP_FACTOR)
@@ -29,25 +29,22 @@ static void cmp_node_antialiasing_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"Specifies the threshold or sensitivity to edges. Lowering this value you will be able "
"to detect more edges at the expense of performance")
.compositor_expects_single_value();
"to detect more edges at the expense of performance");
b.add_input<decl::Float>("Contrast Limit")
.default_value(2.0f)
.min(0.0f)
.description(
"If there is an neighbor edge that has a Contrast Limit times bigger contrast than "
"current edge, current edge will be discarded. This allows to eliminate spurious "
"crossing edges")
.compositor_expects_single_value();
"crossing edges");
b.add_input<decl::Float>("Corner Rounding")
.default_value(0.25f)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.description("Specifies how much sharp corners will be rounded")
.compositor_expects_single_value();
.description("Specifies how much sharp corners will be rounded");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -24,22 +24,22 @@ namespace blender::nodes::node_composite_bilateralblur_cc {
static void cmp_node_bilateralblur_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Determinator").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Int>("Size")
.default_value(0)
.min(0)
.description("The size of the blur in pixels")
.compositor_expects_single_value();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Determinator")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Int>("Size").default_value(0).min(0).description(
"The size of the blur in pixels");
b.add_input<decl::Float>("Threshold")
.default_value(0.1f)
.min(0.0f)
.description(
"Pixels are considered in the blur area if the average difference between their "
"determinator and the determinator of the center pixel is less than this threshold")
.compositor_expects_single_value();
"determinator and the determinator of the center pixel is less than this threshold");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -36,17 +36,23 @@ NODE_STORAGE_FUNCS(NodeBlurData)
static void cmp_node_blur_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Vector>("Size").dimensions(2).default_value({0.0f, 0.0f}).min(0.0f);
b.add_input<decl::Bool>("Extend Bounds").default_value(false).compositor_expects_single_value();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("Size")
.dimensions(2)
.default_value({0.0f, 0.0f})
.min(0.0f)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Bool>("Extend Bounds").default_value(false);
b.add_input<decl::Bool>("Separable")
.default_value(true)
.compositor_expects_single_value()
.description(
"Use faster approximation by blurring along the horizontal and vertical directions "
"independently");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_blur(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -24,15 +24,23 @@ namespace blender::nodes::node_composite_bokehblur_cc {
static void cmp_node_bokehblur_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({0.8f, 0.8f, 0.8f, 1.0f});
b.add_input<decl::Color>("Image")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Bokeh")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_realization_mode(CompositorInputRealizationMode::Transforms);
b.add_input<decl::Float>("Size").default_value(1.0f).min(0.0f).max(10.0f);
b.add_input<decl::Float>("Bounding box").default_value(1.0f).min(0.0f).max(1.0f);
b.add_input<decl::Bool>("Extend Bounds").default_value(false).compositor_expects_single_value();
.compositor_realization_mode(CompositorInputRealizationMode::Transforms)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Size").default_value(1.0f).min(0.0f).max(10.0f).structure_type(
StructureType::Dynamic);
b.add_input<decl::Float>("Bounding box")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Bool>("Extend Bounds").default_value(false);
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -22,31 +22,25 @@ namespace blender::nodes::node_composite_bokehimage_cc {
static void cmp_node_bokehimage_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Int>("Flaps")
.default_value(5)
.min(3)
.max(24)
.description("The number of flaps in the bokeh")
.compositor_expects_single_value();
b.add_input<decl::Int>("Flaps").default_value(5).min(3).max(24).description(
"The number of flaps in the bokeh");
b.add_input<decl::Float>("Angle")
.default_value(0.0f)
.subtype(PROP_ANGLE)
.description("The angle of the bokeh")
.compositor_expects_single_value();
.description("The angle of the bokeh");
b.add_input<decl::Float>("Roundness")
.default_value(0.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description("Specifies how round the bokeh is, maximum roundness produces a circular bokeh")
.compositor_expects_single_value();
.description(
"Specifies how round the bokeh is, maximum roundness produces a circular bokeh");
b.add_input<decl::Float>("Catadioptric Size")
.default_value(0.0f)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.description("Specifies the size of the catadioptric iris, zero means no iris")
.compositor_expects_single_value();
.description("Specifies the size of the catadioptric iris, zero means no iris");
b.add_input<decl::Float>("Color Shift")
.default_value(0.0f)
.subtype(PROP_FACTOR)
@@ -54,10 +48,9 @@ static void cmp_node_bokehimage_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"Specifies the amount of color shifting. 1 means maximum shifting towards blue while -1 "
"means maximum shifting toward red")
.compositor_expects_single_value();
"means maximum shifting toward red");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -29,25 +29,33 @@ namespace blender::nodes::node_composite_boxmask_cc {
static void cmp_node_boxmask_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("Mask").subtype(PROP_FACTOR).default_value(0.0f).min(0.0f).max(1.0f);
b.add_input<decl::Float>("Value").subtype(PROP_FACTOR).default_value(1.0f).min(0.0f).max(1.0f);
b.add_input<decl::Float>("Mask")
.subtype(PROP_FACTOR)
.default_value(0.0f)
.min(0.0f)
.max(1.0f)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Value")
.subtype(PROP_FACTOR)
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("Position")
.subtype(PROP_FACTOR)
.dimensions(2)
.default_value({0.5f, 0.5f})
.min(-0.5f)
.max(1.5f)
.compositor_expects_single_value();
.max(1.5f);
b.add_input<decl::Vector>("Size")
.subtype(PROP_FACTOR)
.dimensions(2)
.default_value({0.2f, 0.1f})
.min(0.0f)
.max(1.0f)
.compositor_expects_single_value();
b.add_input<decl::Float>("Rotation").subtype(PROP_ANGLE).compositor_expects_single_value();
.max(1.0f);
b.add_input<decl::Float>("Rotation").subtype(PROP_ANGLE);
b.add_output<decl::Float>("Mask");
b.add_output<decl::Float>("Mask").structure_type(StructureType::Dynamic);
}
static void node_composit_buts_boxmask(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -27,6 +27,7 @@ namespace blender::nodes::node_composite_brightness_cc {
static void cmp_node_brightcontrast_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Bright").min(-100.0f).max(100.0f);
b.add_input<decl::Float>("Contrast").min(-100.0f).max(100.0f);

View File

@@ -32,6 +32,7 @@ NODE_STORAGE_FUNCS(NodeChroma)
static void cmp_node_channel_matte_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Minimum")
.default_value(0.0f)

View File

@@ -30,6 +30,7 @@ namespace blender::nodes::node_composite_chroma_matte_cc {
static void cmp_node_chroma_matte_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Key Color").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Minimum")

View File

@@ -27,6 +27,7 @@ namespace blender::nodes::node_composite_color_matte_cc {
static void cmp_node_color_matte_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Key Color").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Hue")

View File

@@ -29,6 +29,7 @@ NODE_STORAGE_FUNCS(NodeColorspill)
static void cmp_node_color_spill_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.use_custom_socket_order();
b.add_output<decl::Color>("Image");

View File

@@ -39,6 +39,7 @@ namespace blender::nodes::node_composite_colorbalance_cc {
static void cmp_node_colorbalance_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.use_custom_socket_order();
b.add_output<decl::Color>("Image");

View File

@@ -28,6 +28,7 @@ namespace blender::nodes::node_composite_colorcorrection_cc {
static void cmp_node_colorcorrection_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.use_custom_socket_order();
b.add_output<decl::Color>("Image");

View File

@@ -25,7 +25,9 @@ namespace blender::nodes::node_composite_composite_cc {
static void cmp_node_composite_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({0.0f, 0.0f, 0.0f, 1.0f});
b.add_input<decl::Color>("Image")
.default_value({0.0f, 0.0f, 0.0f, 1.0f})
.structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -29,8 +29,9 @@ static void CMP_NODE_CONVERT_COLOR_SPACE_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
b.add_output<decl::Color>("Image");
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_convert_colorspace(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -31,38 +31,34 @@ static void cmp_node_cornerpin_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("Upper Left")
.subtype(PROP_FACTOR)
.dimensions(2)
.default_value({0.0f, 1.0f})
.min(0.0f)
.max(1.0f)
.compositor_expects_single_value();
.max(1.0f);
b.add_input<decl::Vector>("Upper Right")
.subtype(PROP_FACTOR)
.dimensions(2)
.default_value({1.0f, 1.0f})
.min(0.0f)
.max(1.0f)
.compositor_expects_single_value();
.max(1.0f);
b.add_input<decl::Vector>("Lower Left")
.subtype(PROP_FACTOR)
.dimensions(2)
.default_value({0.0f, 0.0f})
.min(0.0f)
.max(1.0f)
.compositor_expects_single_value();
.max(1.0f);
b.add_input<decl::Vector>("Lower Right")
.subtype(PROP_FACTOR)
.dimensions(2)
.default_value({1.0f, 0.0f})
.min(0.0f)
.max(1.0f)
.compositor_expects_single_value();
.max(1.0f);
b.add_output<decl::Color>("Image");
b.add_output<decl::Float>("Plane");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Plane").structure_type(StructureType::Dynamic);
}
static void node_composit_init_cornerpin(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -27,35 +27,37 @@ namespace blender::nodes::node_composite_crop_cc {
static void cmp_node_crop_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Int>("X")
.default_value(0)
.min(0)
.compositor_expects_single_value()
.description("The X position of the lower left corner of the crop region");
b.add_input<decl::Int>("Y")
.default_value(0)
.min(0)
.compositor_expects_single_value()
.description("The Y position of the lower left corner of the crop region");
b.add_input<decl::Int>("Width")
.default_value(1920)
.min(1)
.compositor_expects_single_value()
.description("The width of the crop region");
b.add_input<decl::Int>("Height")
.default_value(1080)
.min(1)
.compositor_expects_single_value()
.description("The width of the crop region");
b.add_input<decl::Bool>("Alpha Crop")
.default_value(false)
.compositor_expects_single_value()
.description(
"Sets the areas outside of the crop region to be transparent instead of actually "
"cropping the size of the image");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -582,10 +582,11 @@ static void cmp_node_cryptomatte_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({0.0f, 0.0f, 0.0f, 1.0f})
.compositor_domain_priority(0);
b.add_output<decl::Color>("Image");
b.add_output<decl::Float>("Matte");
b.add_output<decl::Color>("Pick");
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Matte").structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Pick").structure_type(StructureType::Dynamic);
}
static void node_init_cryptomatte(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -32,8 +32,8 @@ namespace blender::nodes::node_composite_time_curves_cc {
static void cmp_node_time_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Int>("Start Frame").default_value(1).compositor_expects_single_value();
b.add_input<decl::Int>("End Frame").default_value(250).compositor_expects_single_value();
b.add_input<decl::Int>("Start Frame").default_value(1);
b.add_input<decl::Int>("End Frame").default_value(250);
b.add_output<decl::Float>("Fac");
}
@@ -129,6 +129,7 @@ namespace blender::nodes::node_composite_rgb_curves_cc {
static void cmp_node_rgbcurves_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac")
.default_value(1.0f)
.min(0.0f)

View File

@@ -38,10 +38,10 @@ static void cmp_node_defocus_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
b.add_input<decl::Float>("Z").default_value(1.0f).min(0.0f).max(1.0f).compositor_domain_priority(
1);
b.add_output<decl::Color>("Image");
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Z").default_value(1.0f).min(0.0f).max(1.0f).structure_type(
StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_defocus(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -42,20 +42,23 @@ static void cmp_node_denoise_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.compositor_domain_priority(0)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("Normal")
.default_value({0.0f, 0.0f, 0.0f})
.min(-1.0f)
.max(1.0f)
.hide_value()
.compositor_domain_priority(2);
.compositor_domain_priority(2)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Albedo")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.hide_value()
.compositor_domain_priority(1);
b.add_input<decl::Bool>("HDR").default_value(true).compositor_expects_single_value();
.compositor_domain_priority(1)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Bool>("HDR").default_value(true);
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_denonise(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -31,17 +31,18 @@ static void cmp_node_despeckle_declare(NodeDeclarationBuilder &b)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.compositor_domain_priority(1);
.compositor_domain_priority(1)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.compositor_domain_priority(0)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Color Threshold")
.default_value(0.5f)
.min(0.0f)
.description(
"Pixels are despeckled only if their color difference from the average color of their "
"neighbors exceeds this threshold")
.compositor_expects_single_value();
"neighbors exceeds this threshold");
b.add_input<decl::Float>("Neighbor Threshold")
.default_value(0.5f)
.subtype(PROP_FACTOR)
@@ -50,10 +51,9 @@ static void cmp_node_despeckle_declare(NodeDeclarationBuilder &b)
.description(
"Pixels are despeckled only if the number of pixels in their neighborhood that are "
"different exceed this ratio threshold relative to the total number of neighbors. "
"Neighbors are considered different if they exceed the color threshold input")
.compositor_expects_single_value();
"Neighbors are considered different if they exceed the color threshold input");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -26,6 +26,7 @@ namespace blender::nodes::node_composite_diff_matte_cc {
static void cmp_node_diff_matte_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image 1").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Image 2").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Tolerance")

View File

@@ -37,22 +37,19 @@ NODE_STORAGE_FUNCS(NodeDilateErode)
static void cmp_node_dilate_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("Mask").default_value(0.0f).min(0.0f).max(1.0f);
b.add_input<decl::Int>("Size")
.default_value(0)
.description(
"The size of dilation/erosion in pixels. Positive values dilates and negative values "
"erodes")
.compositor_expects_single_value();
b.add_input<decl::Float>("Mask").default_value(0.0f).min(0.0f).max(1.0f).structure_type(
StructureType::Dynamic);
b.add_input<decl::Int>("Size").default_value(0).description(
"The size of dilation/erosion in pixels. Positive values dilates and negative values "
"erodes");
b.add_input<decl::Float>("Falloff Size")
.default_value(0.0f)
.min(0.0f)
.description(
"The size of the falloff from the edges in pixels. If less than two pixels, the edges "
"will be anti-aliased")
.compositor_expects_single_value();
"will be anti-aliased");
b.add_output<decl::Float>("Mask");
b.add_output<decl::Float>("Mask").structure_type(StructureType::Dynamic);
}
static void node_composit_init_dilateerode(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -24,18 +24,15 @@ static void cmp_node_directional_blur_declare(NodeDeclarationBuilder &b)
{
b.use_custom_socket_order();
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Int>("Samples")
.default_value(1)
.min(1)
.max(32)
.description(
"The number of samples used to compute the blur. The more samples the smoother the "
"result, but at the expense of more compute time. The actual number of samples is two "
"to the power of this input, so it increases exponentially")
.compositor_expects_single_value();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Int>("Samples").default_value(1).min(1).max(32).description(
"The number of samples used to compute the blur. The more samples the smoother the "
"result, but at the expense of more compute time. The actual number of samples is two "
"to the power of this input, so it increases exponentially");
b.add_input<decl::Vector>("Center")
.subtype(PROP_FACTOR)
.dimensions(2)
@@ -44,19 +41,14 @@ static void cmp_node_directional_blur_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"The position at which the transformations pivot around. Defined in normalized "
"coordinates, so 0 means lower left corner and 1 means upper right corner of the image")
.compositor_expects_single_value();
"coordinates, so 0 means lower left corner and 1 means upper right corner of the image");
b.add_input<decl::Float>("Rotation")
.default_value(0.0f)
.subtype(PROP_ANGLE)
.description("The amount of rotation that the blur spans")
.compositor_expects_single_value();
b.add_input<decl::Float>("Scale")
.default_value(1.0f)
.min(0.0f)
.description("The amount of scaling that the blur spans")
.compositor_expects_single_value();
.description("The amount of rotation that the blur spans");
b.add_input<decl::Float>("Scale").default_value(1.0f).min(0.0f).description(
"The amount of scaling that the blur spans");
PanelDeclarationBuilder &translation_panel = b.add_panel("Translation").default_closed(false);
translation_panel.add_input<decl::Float>("Amount", "Translation Amount")
@@ -66,13 +58,11 @@ static void cmp_node_directional_blur_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"The amount of translation that the blur spans in the specified direction relative to "
"the size of the image. Negative values indicate translation in the opposite direction")
.compositor_expects_single_value();
"the size of the image. Negative values indicate translation in the opposite direction");
translation_panel.add_input<decl::Float>("Direction", "Translation Direction")
.default_value(0.0f)
.subtype(PROP_ANGLE)
.description("The angle that defines the direction of the translation")
.compositor_expects_single_value();
.description("The angle that defines the direction of the translation");
}
using namespace blender::compositor;

View File

@@ -38,25 +38,26 @@ static void cmp_node_displace_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("Vector")
.dimensions(2)
.default_value({1.0f, 1.0f})
.min(0.0f)
.max(1.0f)
.subtype(PROP_TRANSLATION)
.compositor_domain_priority(1);
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("X Scale")
.default_value(0.0f)
.min(-1000.0f)
.max(1000.0f)
.compositor_domain_priority(2);
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Y Scale")
.default_value(0.0f)
.min(-1000.0f)
.max(1000.0f)
.compositor_domain_priority(3);
b.add_output<decl::Color>("Image");
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void cmp_node_init_displace(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -30,6 +30,7 @@ NODE_STORAGE_FUNCS(NodeChroma)
static void cmp_node_distance_matte_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Key Color").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Tolerance")

View File

@@ -25,13 +25,16 @@ static void cmp_node_double_edge_mask_declare(NodeDeclarationBuilder &b)
.default_value(0.8f)
.min(0.0f)
.max(1.0f)
.compositor_domain_priority(1);
.compositor_domain_priority(1)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Outer Mask")
.default_value(0.8f)
.min(0.0f)
.max(1.0f)
.compositor_domain_priority(0);
b.add_output<decl::Float>("Mask");
.compositor_domain_priority(0)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Mask").structure_type(StructureType::Dynamic);
}
static void node_composit_buts_double_edge_mask(uiLayout *layout,

View File

@@ -28,25 +28,33 @@ namespace blender::nodes::node_composite_ellipsemask_cc {
static void cmp_node_ellipsemask_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("Mask").subtype(PROP_FACTOR).default_value(0.0f).min(0.0f).max(1.0f);
b.add_input<decl::Float>("Value").subtype(PROP_FACTOR).default_value(1.0f).min(0.0f).max(1.0f);
b.add_input<decl::Float>("Mask")
.subtype(PROP_FACTOR)
.default_value(0.0f)
.min(0.0f)
.max(1.0f)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Value")
.subtype(PROP_FACTOR)
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("Position")
.subtype(PROP_FACTOR)
.dimensions(2)
.default_value({0.5f, 0.5f})
.min(-0.5f)
.max(1.5f)
.compositor_expects_single_value();
.max(1.5f);
b.add_input<decl::Vector>("Size")
.subtype(PROP_FACTOR)
.dimensions(2)
.default_value({0.2f, 0.1f})
.min(0.0f)
.max(1.0f)
.compositor_expects_single_value();
b.add_input<decl::Float>("Rotation").subtype(PROP_ANGLE).compositor_expects_single_value();
.max(1.0f);
b.add_input<decl::Float>("Rotation").subtype(PROP_ANGLE);
b.add_output<decl::Float>("Mask");
b.add_output<decl::Float>("Mask").structure_type(StructureType::Dynamic);
}
static void node_composit_buts_ellipsemask(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -24,6 +24,7 @@ namespace blender::nodes::node_composite_exposure_cc {
static void cmp_node_exposure_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);

View File

@@ -29,11 +29,14 @@ static void cmp_node_filter_declare(NodeDeclarationBuilder &b)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.compositor_domain_priority(1);
.compositor_domain_priority(1)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
b.add_output<decl::Color>("Image");
.compositor_domain_priority(0)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_buts_filter(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -21,11 +21,13 @@ namespace blender::nodes::node_composite_flip_cc {
static void cmp_node_flip_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Bool>("Flip X").default_value(false).compositor_expects_single_value();
b.add_input<decl::Bool>("Flip Y").default_value(false).compositor_expects_single_value();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Bool>("Flip X").default_value(false);
b.add_input<decl::Bool>("Flip Y").default_value(false);
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -23,6 +23,7 @@ namespace blender::nodes::node_composite_gamma_cc {
static void cmp_node_gamma_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);

View File

@@ -55,9 +55,14 @@ static void cmp_node_glare_declare(NodeDeclarationBuilder &b)
{
b.use_custom_socket_order();
b.add_output<decl::Color>("Image").description("The image with the generated glare added");
b.add_output<decl::Color>("Glare").description("The generated glare");
b.add_output<decl::Color>("Image")
.structure_type(StructureType::Dynamic)
.description("The image with the generated glare added");
b.add_output<decl::Color>("Glare")
.structure_type(StructureType::Dynamic)
.description("The generated glare");
b.add_output<decl::Color>("Highlights")
.structure_type(StructureType::Dynamic)
.description("The extracted highlights from which the glare was generated");
b.add_layout([](uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) {
@@ -74,7 +79,7 @@ static void cmp_node_glare_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.structure_type(StructureType::Dynamic);
PanelDeclarationBuilder &highlights_panel = b.add_panel("Highlights").default_closed(true);
highlights_panel.add_input<decl::Float>("Threshold", "Highlights Threshold")
@@ -82,29 +87,25 @@ static void cmp_node_glare_declare(NodeDeclarationBuilder &b)
.min(0.0f)
.description(
"The brightness level at which pixels are considered part of the highlights that "
"produce a glare")
.compositor_expects_single_value();
"produce a glare");
highlights_panel.add_input<decl::Float>("Smoothness", "Highlights Smoothness")
.default_value(0.1f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description("The smoothness of the extracted highlights")
.compositor_expects_single_value();
.description("The smoothness of the extracted highlights");
PanelDeclarationBuilder &supress_highlights_panel =
highlights_panel.add_panel("Clamp").default_closed(true);
supress_highlights_panel.add_input<decl::Bool>("Clamp", "Clamp Highlights")
.default_value(false)
.panel_toggle()
.description("Clamp bright highlights")
.compositor_expects_single_value();
.description("Clamp bright highlights");
supress_highlights_panel.add_input<decl::Float>("Maximum", "Maximum Highlights")
.default_value(10.0f)
.min(0.0f)
.description(
"Clamp bright highlights such that their brightness are not larger than this value")
.compositor_expects_single_value();
"Clamp bright highlights such that their brightness are not larger than this value");
PanelDeclarationBuilder &mix_panel = b.add_panel("Adjust");
mix_panel.add_input<decl::Float>("Strength")
@@ -112,19 +113,16 @@ static void cmp_node_glare_declare(NodeDeclarationBuilder &b)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description("Adjusts the brightness of the glare")
.compositor_expects_single_value();
.description("Adjusts the brightness of the glare");
mix_panel.add_input<decl::Float>("Saturation")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description("Adjusts the saturation of the glare")
.compositor_expects_single_value();
.description("Adjusts the saturation of the glare");
mix_panel.add_input<decl::Color>("Tint")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.description("Tints the glare. Consider desaturating the glare to more accurate tinting")
.compositor_expects_single_value();
.description("Tints the glare. Consider desaturating the glare to more accurate tinting");
PanelDeclarationBuilder &glare_panel = b.add_panel("Glare");
glare_panel.add_input<decl::Float>("Size")
@@ -134,45 +132,35 @@ static void cmp_node_glare_declare(NodeDeclarationBuilder &b)
.subtype(PROP_FACTOR)
.description(
"The size of the glare relative to the image. 1 means the glare covers the entire "
"image, 0.5 means the glare covers half the image, and so on")
.compositor_expects_single_value();
glare_panel.add_input<decl::Int>("Streaks")
.default_value(4)
.min(1)
.max(16)
.description("The number of streaks")
.compositor_expects_single_value();
"image, 0.5 means the glare covers half the image, and so on");
glare_panel.add_input<decl::Int>("Streaks").default_value(4).min(1).max(16).description(
"The number of streaks");
glare_panel.add_input<decl::Float>("Streaks Angle")
.default_value(0.0f)
.subtype(PROP_ANGLE)
.description("The angle that the first streak makes with the horizontal axis")
.compositor_expects_single_value();
.description("The angle that the first streak makes with the horizontal axis");
glare_panel.add_input<decl::Int>("Iterations")
.default_value(3)
.min(2)
.max(5)
.description(
"The number of ghosts for Ghost glare or the quality and spread of Glare for Streaks "
"and Simple Star")
.compositor_expects_single_value();
"and Simple Star");
glare_panel.add_input<decl::Float>("Fade")
.default_value(0.9f)
.min(0.75f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description("Streak fade-out factor")
.compositor_expects_single_value();
.description("Streak fade-out factor");
glare_panel.add_input<decl::Float>("Color Modulation")
.default_value(0.25)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description("Modulates colors of streaks and ghosts for a spectral dispersion effect")
.compositor_expects_single_value();
.description("Modulates colors of streaks and ghosts for a spectral dispersion effect");
glare_panel.add_input<decl::Bool>("Diagonal", "Diagonal Star")
.default_value(true)
.description("Align the star diagonally")
.compositor_expects_single_value();
.description("Align the star diagonally");
}
static void node_composit_init_glare(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -25,6 +25,7 @@ namespace blender::nodes::node_composite_hue_sat_val_cc {
static void cmp_node_huesatval_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);

View File

@@ -26,6 +26,7 @@ namespace blender::nodes::node_composite_huecorrect_cc {
static void cmp_node_huecorrect_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac")
.default_value(1.0f)
.min(0.0f)

View File

@@ -27,11 +27,15 @@ namespace blender::nodes::node_composite_id_mask_cc {
static void cmp_node_idmask_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("ID value").default_value(1.0f).min(0.0f).max(1.0f);
b.add_input<decl::Int>("Index").default_value(0).min(0).compositor_expects_single_value();
b.add_input<decl::Bool>("Anti-Alias").default_value(false).compositor_expects_single_value();
b.add_input<decl::Float>("ID value")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Int>("Index").default_value(0).min(0);
b.add_input<decl::Bool>("Anti-Alias").default_value(false);
b.add_output<decl::Float>("Alpha");
b.add_output<decl::Float>("Alpha").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -10,15 +10,24 @@ namespace blender::nodes::node_composite_image_coordinates_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").hide_value().compositor_realization_mode(
CompositorInputRealizationMode::None);
b.add_input<decl::Color>("Image")
.hide_value()
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Vector>("Uniform").dimensions(2).description(
"Zero centered coordinates normalizes along the larger dimension for uniform scaling");
b.add_output<decl::Vector>("Uniform")
.dimensions(2)
.structure_type(StructureType::Dynamic)
.description(
"Zero centered coordinates normalizes along the larger dimension for uniform scaling");
b.add_output<decl::Vector>("Normalized")
.dimensions(2)
.structure_type(StructureType::Dynamic)
.description("Normalized coordinates with half pixel offsets");
b.add_output<decl::Vector>("Pixel").dimensions(2).description("Integer pixel coordinates");
b.add_output<decl::Vector>("Pixel")
.dimensions(2)
.structure_type(StructureType::Dynamic)
.description("Integer pixel coordinates");
}
using namespace blender::compositor;

View File

@@ -15,8 +15,10 @@ namespace blender::nodes::node_composite_image_info_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").hide_value().compositor_realization_mode(
CompositorInputRealizationMode::None);
b.add_input<decl::Color>("Image")
.hide_value()
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Vector>("Dimensions")
.dimensions(2)

View File

@@ -28,14 +28,11 @@ static void cmp_node_inpaint_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
b.add_input<decl::Int>("Size")
.default_value(0)
.min(0)
.description("The size of the inpaint in pixels")
.compositor_expects_single_value();
.structure_type(StructureType::Dynamic);
b.add_input<decl::Int>("Size").default_value(0).min(0).description(
"The size of the inpaint in pixels");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -25,6 +25,7 @@ namespace blender::nodes::node_composite_invert_cc {
static void cmp_node_invert_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Fac")
.default_value(1.0f)
.min(0.0f)

View File

@@ -34,12 +34,16 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
{
b.use_custom_socket_order();
b.add_output<decl::Color>("Image");
b.add_output<decl::Float>("Matte");
b.add_output<decl::Float>("Edges");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Matte").structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Edges").structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Image").default_value({0.8f, 0.8f, 0.8f, 1.0f});
b.add_input<decl::Color>("Key Color").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Image")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Key Color")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
PanelDeclarationBuilder &preprocess_panel = b.add_panel("Preprocess").default_closed(true);
preprocess_panel.add_input<decl::Int>("Blur Size", "Preprocess Blur Size")
@@ -47,8 +51,7 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.min(0)
.description(
"Blur the color of the input image in YCC color space before keying while leaving the "
"luminance intact using a Gaussian blur of the given size")
.compositor_expects_single_value();
"luminance intact using a Gaussian blur of the given size");
PanelDeclarationBuilder &key_panel = b.add_panel("Key").default_closed(true).translation_context(
BLT_I18NCONTEXT_ID_NODETREE);
@@ -60,8 +63,7 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.description(
"Balances between the two non primary color channels that the primary channel compares "
"against. 0 means the latter channel of the two is used, while 1 means the former of "
"the two is used")
.compositor_expects_single_value();
"the two is used");
PanelDeclarationBuilder &tweak_panel = b.add_panel("Tweak").default_closed(true);
tweak_panel.add_input<decl::Float>("Black Level")
@@ -71,8 +73,7 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"The matte gets remapped such matte values lower than the black level become black. "
"Pixels at the identified edges are excluded from the remapping to preserve details")
.compositor_expects_single_value();
"Pixels at the identified edges are excluded from the remapping to preserve details");
tweak_panel.add_input<decl::Float>("White Level")
.default_value(1.0f)
.subtype(PROP_FACTOR)
@@ -80,8 +81,7 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"The matte gets remapped such matte values higher than the white level become white. "
"Pixels at the identified edges are excluded from the remapping to preserve details")
.compositor_expects_single_value();
"Pixels at the identified edges are excluded from the remapping to preserve details");
PanelDeclarationBuilder &edges_panel = tweak_panel.add_panel("Edges").default_closed(true);
edges_panel.add_input<decl::Int>("Size", "Edge Search Size")
@@ -90,8 +90,7 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.description(
"Size of the search window used to identify edges. Higher search size corresponds to "
"less noisy and higher quality edges, not necessarily bigger edges. Edge tolerance can "
"be used to expend the size of the edges")
.compositor_expects_single_value();
"be used to expend the size of the edges");
edges_panel.add_input<decl::Float>("Tolerance", "Edge Tolerance")
.default_value(0.1f)
.subtype(PROP_FACTOR)
@@ -99,8 +98,7 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"Pixels are considered part of the edges if more than 10% of the neighbouring pixels "
"have matte values that differ from the pixel's matte value by this tolerance")
.compositor_expects_single_value();
"have matte values that differ from the pixel's matte value by this tolerance");
PanelDeclarationBuilder &mask_panel = b.add_panel("Mask").default_closed(true);
mask_panel.add_input<decl::Float>("Garbage Matte")
@@ -108,33 +106,32 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.structure_type(StructureType::Dynamic)
.description("Areas in the garbage matte mask are excluded from the matte");
mask_panel.add_input<decl::Float>("Core Matte")
.default_value(0.0f)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.structure_type(StructureType::Dynamic)
.description("Areas in the core matte mask are included in the matte");
PanelDeclarationBuilder &postprocess_panel = b.add_panel("Postprocess").default_closed(true);
postprocess_panel.add_input<decl::Int>("Blur Size", "Postprocess Blur Size")
.default_value(0)
.min(0)
.description("Blur the computed matte using a Gaussian blur of the given size")
.compositor_expects_single_value();
.description("Blur the computed matte using a Gaussian blur of the given size");
postprocess_panel.add_input<decl::Int>("Dilate Size", "Postprocess Dilate Size")
.default_value(0)
.description(
"Dilate or erode the computed matte using a circular structuring element of the "
"specified size. Negative sizes means erosion while positive means dilation")
.compositor_expects_single_value();
"specified size. Negative sizes means erosion while positive means dilation");
postprocess_panel.add_input<decl::Int>("Feather Size", "Postprocess Feather Size")
.default_value(0)
.description(
"Dilate or erode the computed matte using an inverse distance operation evaluated at "
"the given falloff of the specified size. Negative sizes means erosion while positive "
"means dilation")
.compositor_expects_single_value();
"means dilation");
postprocess_panel.add_layout([](uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) {
layout->prop(ptr, "feather_falloff", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
});
@@ -145,8 +142,7 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.description("Specifies the strength of the despill")
.compositor_expects_single_value();
.description("Specifies the strength of the despill");
despill_panel.add_input<decl::Float>("Balance", "Despill Balance")
.default_value(0.5f)
.subtype(PROP_FACTOR)
@@ -155,8 +151,7 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b)
.description(
"Defines the channel used for despill limiting. Balances between the two non primary "
"color channels that the primary channel compares against. 0 means the latter channel "
"of the two is used, while 1 means the former of the two is used")
.compositor_expects_single_value();
"of the two is used, while 1 means the former of the two is used");
}
static void node_composit_init_keying(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -46,7 +46,9 @@ static void cmp_node_keyingscreen_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description("Specifies the smoothness of the keying screen");
b.add_output<decl::Color>("Screen").translation_context(BLT_I18NCONTEXT_ID_SCREEN);
b.add_output<decl::Color>("Screen")
.translation_context(BLT_I18NCONTEXT_ID_SCREEN)
.structure_type(StructureType::Dynamic);
}
static void node_composit_init_keyingscreen(const bContext *C, PointerRNA *ptr)

View File

@@ -37,18 +37,17 @@ static void cmp_node_kuwahara_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Size")
.default_value(6.0f)
.description("The size of the filter in pixels")
.compositor_domain_priority(1);
.structure_type(StructureType::Dynamic);
b.add_input<decl::Int>("Uniformity")
.default_value(4)
.min(0)
.description(
"Controls the uniformity of the direction of the filter. Higher values produces more "
"uniform directions")
.compositor_expects_single_value();
"uniform directions");
b.add_input<decl::Float>("Sharpness")
.default_value(1.0f)
.subtype(PROP_FACTOR)
@@ -56,8 +55,7 @@ static void cmp_node_kuwahara_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"Controls the sharpness of the filter. 0 means completely smooth while 1 means "
"completely sharp")
.compositor_expects_single_value();
"completely sharp");
b.add_input<decl::Float>("Eccentricity")
.default_value(1.0f)
.subtype(PROP_FACTOR)
@@ -65,15 +63,13 @@ static void cmp_node_kuwahara_declare(NodeDeclarationBuilder &b)
.max(2.0f)
.description(
"Controls how directional the filter is. 0 means the filter is completely "
"omnidirectional while 2 means it is maximally directed along the edges of the image")
.compositor_expects_single_value();
"omnidirectional while 2 means it is maximally directed along the edges of the image");
b.add_input<decl::Bool>("High Precision")
.default_value(false)
.description(
"Uses a more precise but slower method. Use if the output contains undesirable noise.")
.compositor_expects_single_value();
"Uses a more precise but slower method. Use if the output contains undesirable noise.");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_kuwahara(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -40,7 +40,9 @@ NODE_STORAGE_FUNCS(NodeLensDist)
static void cmp_node_lensdist_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Distortion")
.default_value(0.0f)
.subtype(PROP_FACTOR)
@@ -48,28 +50,21 @@ static void cmp_node_lensdist_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"The amount of distortion. 0 means no distortion, -1 means full Pincushion distortion, "
"and 1 means full Barrel distortion")
.compositor_expects_single_value();
"and 1 means full Barrel distortion");
b.add_input<decl::Float>("Dispersion")
.default_value(0.0f)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.description("The amount of chromatic aberration to add to the distortion")
.compositor_expects_single_value();
b.add_input<decl::Bool>("Jitter")
.default_value(false)
.description(
"Introduces jitter while doing distortion, which can be faster but can produce grainy "
"or noisy results")
.compositor_expects_single_value();
b.add_input<decl::Bool>("Fit")
.default_value(false)
.description(
"Scales the image such that it fits entirely in the frame, leaving no empty spaces at "
"the corners")
.compositor_expects_single_value();
b.add_output<decl::Color>("Image");
.description("The amount of chromatic aberration to add to the distortion");
b.add_input<decl::Bool>("Jitter").default_value(false).description(
"Introduces jitter while doing distortion, which can be faster but can produce grainy "
"or noisy results");
b.add_input<decl::Bool>("Fit").default_value(false).description(
"Scales the image such that it fits entirely in the frame, leaving no empty spaces at "
"the corners");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_lensdist(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -30,7 +30,8 @@ static void cmp_node_levels_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({0.0f, 0.0f, 0.0f, 1.0f})
.compositor_domain_priority(0);
.structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Mean");
b.add_output<decl::Float>("Standard Deviation");
}

View File

@@ -28,6 +28,7 @@ namespace blender::nodes::node_composite_luma_matte_cc {
static void cmp_node_luma_matte_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Float>("Minimum")
.default_value(0.0f)

View File

@@ -32,7 +32,8 @@ static void cmp_node_map_uv_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_realization_mode(CompositorInputRealizationMode::Transforms);
.compositor_realization_mode(CompositorInputRealizationMode::Transforms)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("UV")
.default_value({1.0f, 0.0f, 0.0f})
.min(0.0f)
@@ -40,8 +41,10 @@ static void cmp_node_map_uv_declare(NodeDeclarationBuilder &b)
.description(
"The UV coordinates at which to sample the texture. The Z component is assumed to "
"contain an alpha channel")
.compositor_domain_priority(0);
b.add_output<decl::Color>("Image");
.compositor_domain_priority(0)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_buts_map_uv(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)

View File

@@ -29,47 +29,36 @@ static void cmp_node_mask_declare(NodeDeclarationBuilder &b)
{
b.use_custom_socket_order();
b.add_output<decl::Float>("Mask");
b.add_output<decl::Float>("Mask").structure_type(StructureType::Dynamic);
b.add_layout([](uiLayout *layout, bContext *C, PointerRNA *ptr) {
uiTemplateID(layout, C, ptr, "mask", nullptr, nullptr, nullptr);
layout->prop(ptr, "size_source", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
});
b.add_input<decl::Int>("Size X")
.default_value(256)
.min(1)
.description("The resolution of the mask along the X direction")
.compositor_expects_single_value();
b.add_input<decl::Int>("Size Y")
.default_value(256)
.min(1)
.description("The resolution of the mask along the Y direction")
.compositor_expects_single_value();
b.add_input<decl::Bool>("Feather")
.default_value(true)
.description("Use feather information from the mask")
.compositor_expects_single_value();
b.add_input<decl::Int>("Size X").default_value(256).min(1).description(
"The resolution of the mask along the X direction");
b.add_input<decl::Int>("Size Y").default_value(256).min(1).description(
"The resolution of the mask along the Y direction");
b.add_input<decl::Bool>("Feather").default_value(true).description(
"Use feather information from the mask");
PanelDeclarationBuilder &motion_blur_panel = b.add_panel("Motion Blur").default_closed(true);
motion_blur_panel.add_input<decl::Bool>("Motion Blur")
.default_value(false)
.panel_toggle()
.description("Use multi-sampled motion blur of the mask")
.compositor_expects_single_value();
.description("Use multi-sampled motion blur of the mask");
motion_blur_panel.add_input<decl::Int>("Samples", "Motion Blur Samples")
.default_value(16)
.min(1)
.max(64)
.description("Number of motion blur samples")
.compositor_expects_single_value();
.description("Number of motion blur samples");
motion_blur_panel.add_input<decl::Float>("Shutter", "Motion Blur Shutter")
.default_value(0.5f)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.description("Exposure for motion blur as a factor of FPS")
.compositor_expects_single_value();
.description("Exposure for motion blur as a factor of FPS");
}
static void node_mask_label(const bNodeTree * /*ntree*/,

View File

@@ -34,8 +34,8 @@ namespace blender::nodes::node_composite_movieclip_cc {
static void cmp_node_movieclip_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Color>("Image");
b.add_output<decl::Float>("Alpha");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Alpha").structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Offset X");
b.add_output<decl::Float>("Offset Y");
b.add_output<decl::Float>("Scale");

View File

@@ -36,8 +36,9 @@ static void cmp_node_moviedistortion_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.compositor_domain_priority(0);
b.add_output<decl::Color>("Image");
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void init(const bContext *C, PointerRNA *ptr)

View File

@@ -25,6 +25,7 @@ namespace blender::nodes::node_composite_normal_cc {
static void cmp_node_normal_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_output<decl::Vector>("Normal")
.default_value({0.0f, 0.0f, 1.0f})
.min(-1.0f)

View File

@@ -18,12 +18,9 @@ namespace blender::nodes::node_composite_normalize_cc {
static void cmp_node_normalize_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("Value")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.compositor_domain_priority(0);
b.add_output<decl::Float>("Value");
b.add_input<decl::Float>("Value").default_value(1.0f).min(0.0f).max(1.0f).structure_type(
StructureType::Dynamic);
b.add_output<decl::Float>("Value").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -24,14 +24,11 @@ namespace blender::nodes::node_composite_pixelate_cc {
static void cmp_node_pixelate_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Color").compositor_domain_priority(0);
b.add_input<decl::Int>("Size")
.default_value(1)
.min(1)
.description("The number of pixels that correspond to the same output pixel")
.compositor_expects_single_value();
b.add_input<decl::Color>("Color").structure_type(StructureType::Dynamic);
b.add_input<decl::Int>("Size").default_value(1).min(1).description(
"The number of pixels that correspond to the same output pixel");
b.add_output<decl::Color>("Color");
b.add_output<decl::Color>("Color").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -45,8 +45,8 @@ static void cmp_node_planetrackdeform_declare(NodeDeclarationBuilder &b)
{
b.use_custom_socket_order();
b.add_output<decl::Color>("Image");
b.add_output<decl::Float>("Plane");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Plane").structure_type(StructureType::Dynamic);
b.add_layout([](uiLayout *layout, bContext *C, PointerRNA *ptr) {
bNode *node = ptr->data_as<bNode>();
@@ -77,27 +77,25 @@ static void cmp_node_planetrackdeform_declare(NodeDeclarationBuilder &b)
}
});
b.add_input<decl::Color>("Image").compositor_realization_mode(
CompositorInputRealizationMode::Transforms);
b.add_input<decl::Color>("Image")
.compositor_realization_mode(CompositorInputRealizationMode::Transforms)
.structure_type(StructureType::Dynamic);
PanelDeclarationBuilder &motion_blur_panel = b.add_panel("Motion Blur").default_closed(true);
motion_blur_panel.add_input<decl::Bool>("Motion Blur")
.default_value(false)
.panel_toggle()
.description("Use multi-sampled motion blur of the plane")
.compositor_expects_single_value();
.description("Use multi-sampled motion blur of the plane");
motion_blur_panel.add_input<decl::Int>("Samples", "Motion Blur Samples")
.default_value(16)
.min(1)
.max(64)
.description("Number of motion blur samples")
.compositor_expects_single_value();
.description("Number of motion blur samples");
motion_blur_panel.add_input<decl::Float>("Shutter", "Motion Blur Shutter")
.default_value(0.5f)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.description("Exposure for motion blur as a factor of FPS")
.compositor_expects_single_value();
.description("Exposure for motion blur as a factor of FPS");
}
static void init(const bContext *C, PointerRNA *ptr)

View File

@@ -24,6 +24,7 @@ namespace blender::nodes::node_composite_posterize_cc {
static void cmp_node_posterize_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);

View File

@@ -25,6 +25,7 @@ namespace blender::nodes::node_composite_premulkey_cc {
static void cmp_node_premulkey_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);

View File

@@ -27,18 +27,17 @@ static void node_declare(NodeDeclarationBuilder &b)
.min(0.0f)
.max(1.0f)
.description(
"A value that is relative to the image size and needs to be converted to be in pixels")
.compositor_expects_single_value();
"A value that is relative to the image size and needs to be converted to be in pixels");
b.add_input<decl::Float>("Value", "Float Value")
.default_value(0.0f)
.subtype(PROP_FACTOR)
.min(0.0f)
.max(1.0f)
.description(
"A value that is relative to the image size and needs to be converted to be in pixels")
.compositor_expects_single_value();
b.add_input<decl::Color>("Image").compositor_realization_mode(
CompositorInputRealizationMode::None);
"A value that is relative to the image size and needs to be converted to be in pixels");
b.add_input<decl::Color>("Image")
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Value", "Float Value");
b.add_output<decl::Vector>("Value", "Vector Value").dimensions(2);

View File

@@ -26,14 +26,11 @@ static void cmp_node_rotate_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_realization_mode(CompositorInputRealizationMode::None)
.compositor_domain_priority(0);
b.add_input<decl::Float>("Angle")
.default_value(0.0f)
.min(-10000.0f)
.max(10000.0f)
.subtype(PROP_ANGLE)
.compositor_expects_single_value();
b.add_output<decl::Color>("Image");
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Angle").default_value(0.0f).min(-10000.0f).max(10000.0f).subtype(
PROP_ANGLE);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_rotate(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -39,11 +39,20 @@ static void cmp_node_scale_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_realization_mode(CompositorInputRealizationMode::None);
b.add_input<decl::Float>("X").default_value(1.0f).min(0.0001f).max(CMP_SCALE_MAX);
b.add_input<decl::Float>("Y").default_value(1.0f).min(0.0001f).max(CMP_SCALE_MAX);
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("X")
.default_value(1.0f)
.min(0.0001f)
.max(CMP_SCALE_MAX)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Y")
.default_value(1.0f)
.min(0.0001f)
.max(CMP_SCALE_MAX)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_scale(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -72,6 +72,7 @@ NODE_STORAGE_FUNCS(NodeCMPCombSepColor)
static void cmp_node_separate_color_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
@@ -252,6 +253,7 @@ NODE_STORAGE_FUNCS(NodeCMPCombSepColor)
static void cmp_node_combine_color_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Float>("Red")
.default_value(0.0f)
.min(0.0f)

View File

@@ -27,6 +27,7 @@ NODE_STORAGE_FUNCS(NodeSetAlpha)
static void cmp_node_setalpha_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);

View File

@@ -37,10 +37,10 @@ static void cmp_node_split_declare(NodeDeclarationBuilder &b)
.subtype(PROP_ANGLE)
.description("Line angle where the image should be split.");
b.add_input<decl::Color>("Image");
b.add_input<decl::Color>("Image", "Image_001");
b.add_input<decl::Color>("Image").structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Image", "Image_001").structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -36,13 +36,12 @@ static void cmp_node_stabilize2d_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.compositor_realization_mode(CompositorInputRealizationMode::None);
b.add_input<decl::Bool>("Invert")
.default_value(false)
.description("Invert stabilization to reintroduce motion to the image")
.compositor_expects_single_value();
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Bool>("Invert").default_value(false).description(
"Invert stabilization to reintroduce motion to the image");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void init(const bContext *C, PointerRNA *ptr)

View File

@@ -23,7 +23,9 @@ namespace blender::nodes::node_composite_sunbeams_cc {
static void cmp_node_sunbeams_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("Source")
.subtype(PROP_FACTOR)
.dimensions(2)
@@ -32,8 +34,7 @@ static void cmp_node_sunbeams_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"The position of the source of the rays in normalized coordinates. 0 means lower left "
"corner and 1 means upper right corner")
.compositor_expects_single_value();
"corner and 1 means upper right corner");
b.add_input<decl::Float>("Length")
.subtype(PROP_FACTOR)
.min(0.0f)
@@ -41,8 +42,7 @@ static void cmp_node_sunbeams_declare(NodeDeclarationBuilder &b)
.default_value(0.2f)
.description(
"The length of rays relative to the size of the image. 0 means no rays and 1 means the "
"rays cover the full extent of the image")
.compositor_expects_single_value();
"rays cover the full extent of the image");
b.add_output<decl::Color>("Image");
}

View File

@@ -18,13 +18,15 @@ namespace blender::nodes::node_composite_switch_cc {
static void cmp_node_switch_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Bool>("Switch").default_value(false).compositor_expects_single_value();
b.add_input<decl::Bool>("Switch").default_value(false);
b.add_input<decl::Color>("Off")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.compositor_realization_mode(CompositorInputRealizationMode::None);
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("On")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.compositor_realization_mode(CompositorInputRealizationMode::None);
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_output<decl::Color>("Image");
}

View File

@@ -21,7 +21,7 @@ namespace blender::nodes::node_composite_switchview_cc {
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_output<decl::Color>(N_("Image"));
b.add_output<decl::Color>(N_("Image")).structure_type(StructureType::Dynamic);
const bNode *node = b.node_or_null();
if (node == nullptr) {
@@ -36,7 +36,9 @@ static void node_declare(NodeDeclarationBuilder &b)
if (srv->viewflag & SCE_VIEW_DISABLE) {
continue;
}
b.add_input<decl::Color>(N_(srv->name)).default_value({0.0f, 0.0f, 0.0f, 1.0f});
b.add_input<decl::Color>(N_(srv->name))
.default_value({0.0f, 0.0f, 0.0f, 1.0f})
.structure_type(StructureType::Dynamic);
}
}
}

View File

@@ -34,41 +34,28 @@ static void cmp_node_tonemap_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Key")
.default_value(0.18f)
.min(0.0f)
.description(
"The luminance that will be mapped to the log average luminance, typically set to the "
"middle gray value")
.compositor_expects_single_value();
b.add_input<decl::Float>("Balance")
.default_value(1.0f)
.min(0.0f)
.description(
"Balances low and high luminance areas. Lower values emphasize details in shadows, "
"while higher values compress highlights more smoothly")
.compositor_expects_single_value();
b.add_input<decl::Float>("Gamma")
.default_value(1.0f)
.min(0.0f)
.description("Gamma correction factor applied after tone mapping")
.compositor_expects_single_value();
b.add_input<decl::Float>("Key").default_value(0.18f).min(0.0f).description(
"The luminance that will be mapped to the log average luminance, typically set to the "
"middle gray value");
b.add_input<decl::Float>("Balance").default_value(1.0f).min(0.0f).description(
"Balances low and high luminance areas. Lower values emphasize details in shadows, "
"while higher values compress highlights more smoothly");
b.add_input<decl::Float>("Gamma").default_value(1.0f).min(0.0f).description(
"Gamma correction factor applied after tone mapping");
b.add_input<decl::Float>("Intensity")
.default_value(0.0f)
.description(
"Controls the intensity of the image, lower values makes it darker while higher values "
"makes it lighter")
.compositor_expects_single_value();
"makes it lighter");
b.add_input<decl::Float>("Contrast")
.default_value(0.0f)
.min(0.0f)
.description(
"Controls the contrast of the image. Zero automatically sets the contrast based on its "
"global range for better luminance distribution")
.compositor_expects_single_value();
"global range for better luminance distribution");
b.add_input<decl::Float>("Light Adaptation")
.default_value(0.0f)
.subtype(PROP_FACTOR)
@@ -76,8 +63,7 @@ static void cmp_node_tonemap_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.description(
"Specifies if tone mapping operates on the entire image or per pixel, 0 means the "
"entire image, 1 means it is per pixel, and values in between blends between both")
.compositor_expects_single_value();
"entire image, 1 means it is per pixel, and values in between blends between both");
b.add_input<decl::Float>("Chromatic Adaptation")
.default_value(0.0f)
.subtype(PROP_FACTOR)
@@ -86,10 +72,9 @@ static void cmp_node_tonemap_declare(NodeDeclarationBuilder &b)
.description(
"Specifies if tone mapping operates on the luminance or on each channel independently, "
"0 means it uses luminance, 1 means it is per channel, and values in between blends "
"between both")
.compositor_expects_single_value();
"between both");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_tonemap(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -25,29 +25,13 @@ static void cmp_node_transform_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.compositor_domain_priority(0)
.compositor_realization_mode(CompositorInputRealizationMode::None);
b.add_input<decl::Float>("X")
.default_value(0.0f)
.min(-10000.0f)
.max(10000.0f)
.compositor_expects_single_value();
b.add_input<decl::Float>("Y")
.default_value(0.0f)
.min(-10000.0f)
.max(10000.0f)
.compositor_expects_single_value();
b.add_input<decl::Float>("Angle")
.default_value(0.0f)
.min(-10000.0f)
.max(10000.0f)
.subtype(PROP_ANGLE)
.compositor_expects_single_value();
b.add_input<decl::Float>("Scale")
.default_value(1.0f)
.min(0.0001f)
.max(CMP_SCALE_MAX)
.compositor_expects_single_value();
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("X").default_value(0.0f).min(-10000.0f).max(10000.0f);
b.add_input<decl::Float>("Y").default_value(0.0f).min(-10000.0f).max(10000.0f);
b.add_input<decl::Float>("Angle").default_value(0.0f).min(-10000.0f).max(10000.0f).subtype(
PROP_ANGLE);
b.add_input<decl::Float>("Scale").default_value(1.0f).min(0.0001f).max(CMP_SCALE_MAX);
b.add_output<decl::Color>("Image");
}

View File

@@ -27,19 +27,12 @@ static void cmp_node_translate_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0)
.compositor_realization_mode(CompositorInputRealizationMode::None);
b.add_input<decl::Float>("X")
.default_value(0.0f)
.min(-10000.0f)
.max(10000.0f)
.compositor_expects_single_value();
b.add_input<decl::Float>("Y")
.default_value(0.0f)
.min(-10000.0f)
.max(10000.0f)
.compositor_expects_single_value();
b.add_output<decl::Color>("Image");
.compositor_realization_mode(CompositorInputRealizationMode::None)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("X").default_value(0.0f).min(-10000.0f).max(10000.0f);
b.add_input<decl::Float>("Y").default_value(0.0f).min(-10000.0f).max(10000.0f);
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
static void node_composit_init_translate(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -23,6 +23,7 @@ namespace blender::nodes::node_composite_rgb_to_bw_cc {
static void cmp_node_rgbtobw_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>("Image")
.default_value({0.8f, 0.8f, 0.8f, 1.0f})
.compositor_domain_priority(0);

View File

@@ -35,28 +35,27 @@ static void cmp_node_vec_blur_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
b.add_input<decl::Float>("Z").default_value(0.0f).min(0.0f).compositor_domain_priority(2);
.compositor_domain_priority(0)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Z")
.default_value(0.0f)
.min(0.0f)
.compositor_domain_priority(2)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Vector>("Speed")
.dimensions(4)
.default_value({0.0f, 0.0f, 0.0f})
.min(0.0f)
.max(1.0f)
.subtype(PROP_VELOCITY)
.compositor_domain_priority(1);
b.add_input<decl::Int>("Samples")
.default_value(32)
.min(1)
.max(256)
.description("The number of samples used to approximate the motion blur")
.compositor_expects_single_value();
b.add_input<decl::Float>("Shutter")
.default_value(0.5f)
.min(0.0f)
.description("Time between shutter opening and closing in frames")
.compositor_expects_single_value();
.compositor_domain_priority(1)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Int>("Samples").default_value(32).min(1).max(256).description(
"The number of samples used to approximate the motion blur");
b.add_input<decl::Float>("Shutter").default_value(0.5f).min(0.0f).description(
"Time between shutter opening and closing in frames");
b.add_output<decl::Color>("Image");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -30,7 +30,9 @@ namespace blender::nodes::node_composite_viewer_cc {
static void cmp_node_viewer_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({0.0f, 0.0f, 0.0f, 1.0f});
b.add_input<decl::Color>("Image")
.default_value({0.0f, 0.0f, 0.0f, 1.0f})
.structure_type(StructureType::Dynamic);
}
static void node_composit_init_viewer(bNodeTree * /*ntree*/, bNode *node)

View File

@@ -28,35 +28,37 @@ static void cmp_node_zcombine_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(0);
.compositor_domain_priority(0)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Z")
.default_value(1.0f)
.min(0.0f)
.max(10000.0f)
.compositor_domain_priority(2);
.compositor_domain_priority(2)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Color>("Image", "Image_001")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.compositor_domain_priority(1);
.compositor_domain_priority(1)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Float>("Z", "Z_001")
.default_value(1.0f)
.min(0.0f)
.max(10000.0f)
.compositor_domain_priority(3);
.compositor_domain_priority(3)
.structure_type(StructureType::Dynamic);
b.add_input<decl::Bool>("Use Alpha")
.default_value(false)
.description(
"Use the alpha of the first input as mixing factor and return the more opaque alpha of "
"the two inputs")
.compositor_expects_single_value();
"the two inputs");
b.add_input<decl::Bool>("Anti-Alias")
.default_value(true)
.description(
"Anti-alias the generated mask before combining for smoother boundaries at the cost of "
"more expensive processing")
.compositor_expects_single_value();
"more expensive processing");
b.add_output<decl::Color>("Image");
b.add_output<decl::Float>("Z");
b.add_output<decl::Color>("Image").structure_type(StructureType::Dynamic);
b.add_output<decl::Float>("Z").structure_type(StructureType::Dynamic);
}
using namespace blender::compositor;

View File

@@ -760,13 +760,6 @@ BaseSocketDeclarationBuilder &BaseSocketDeclarationBuilder::compositor_domain_pr
return *this;
}
BaseSocketDeclarationBuilder &BaseSocketDeclarationBuilder::compositor_expects_single_value(
bool value)
{
decl_base_->compositor_expects_single_value_ = value;
return *this;
}
BaseSocketDeclarationBuilder &BaseSocketDeclarationBuilder::make_available(
std::function<void(bNode &)> fn)
{
@@ -881,11 +874,6 @@ int SocketDeclaration::compositor_domain_priority() const
return compositor_domain_priority_;
}
bool SocketDeclaration::compositor_expects_single_value() const
{
return compositor_expects_single_value_;
}
void SocketDeclaration::make_available(bNode &node) const
{
if (make_available_fn_) {