Nodes: Begin splitting composite node buttons into individual files

Currently, most node buttons are defined in `drawnode.cc` however,
this is inconvenient because it requires editing many files when adding new nodes.
The goal is to minimize the number of files needed to add or update a node.

This commit moves most of the node layout functions for composite nodes into their respected
`source/blender/nodes/composite/nodes` file.

In the future, these functions will be simplified to `node_layout` once files have their own namespace.
See {D13466} for more information.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D13523
This commit is contained in:
Aaron Carlisle 2021-12-15 21:30:04 -05:00 committed by Aaron Carlisle
parent 5de109cc2d
commit 4e98d974b5
Notes: blender-bot 2023-02-13 16:44:36 +01:00
Referenced by commit 3471b0016c, Fix T94215: compositer denoise node UI wrongly shows as disabled
Referenced by issue #94215, Denoise node reports error: "Disabled, built without OpenImageDenoise" even when build with OpenImageDenoise
63 changed files with 1765 additions and 1460 deletions

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** ALPHAOVER ******************** */
@ -42,12 +45,22 @@ static void node_alphaover_init(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = MEM_callocN(sizeof(NodeTwoFloats), "NodeTwoFloats");
}
static void node_composit_buts_alphaover(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "use_premultiply", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "premul", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_alphaover()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_ALPHAOVER, "Alpha Over", NODE_CLASS_OP_COLOR, 0);
ntype.declare = blender::nodes::cmp_node_alphaover_declare;
ntype.draw_buttons = node_composit_buts_alphaover;
node_type_init(&ntype, node_alphaover_init);
node_type_storage(
&ntype, "NodeTwoFloats", node_free_standard_storage, node_copy_standard_storage);

View File

@ -23,6 +23,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Anti-Aliasing (SMAA 1x) ******************** */
@ -49,6 +52,17 @@ static void node_composit_init_antialiasing(bNodeTree *UNUSED(ntree), bNode *nod
node->storage = data;
}
static void node_composit_buts_antialiasing(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "threshold", 0, nullptr, ICON_NONE);
uiItemR(col, ptr, "contrast_limit", 0, nullptr, ICON_NONE);
uiItemR(col, ptr, "corner_rounding", 0, nullptr, ICON_NONE);
}
void register_node_type_cmp_antialiasing()
{
static bNodeType ntype;
@ -56,6 +70,7 @@ void register_node_type_cmp_antialiasing()
cmp_node_type_base(
&ntype, CMP_NODE_ANTIALIASING, "Anti-Aliasing", NODE_CLASS_OP_FILTER, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_antialiasing_declare;
ntype.draw_buttons = node_composit_buts_antialiasing;
node_type_size(&ntype, 170, 140, 200);
node_type_init(&ntype, node_composit_init_antialiasing);
node_type_storage(

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** BILATERALBLUR ******************** */
@ -46,12 +49,25 @@ static void node_composit_init_bilateralblur(bNodeTree *UNUSED(ntree), bNode *no
nbbd->sigma_space = 5.0;
}
static void node_composit_buts_bilateralblur(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "iterations", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "sigma_color", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "sigma_space", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_bilateralblur()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_BILATERALBLUR, "Bilateral Blur", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_bilateralblur_declare;
ntype.draw_buttons = node_composit_buts_bilateralblur;
node_type_init(&ntype, node_composit_init_bilateralblur);
node_type_storage(
&ntype, "NodeBilateralBlurData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -22,6 +22,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** BLUR ******************** */
@ -44,12 +49,54 @@ static void node_composit_init_blur(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = data;
}
static void node_composit_buts_blur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col, *row;
col = uiLayoutColumn(layout, false);
const int filter = RNA_enum_get(ptr, "filter_type");
const int reference = RNA_boolean_get(ptr, "use_variable_size");
uiItemR(col, ptr, "filter_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
if (filter != R_FILTER_FAST_GAUSS) {
uiItemR(col, ptr, "use_variable_size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (!reference) {
uiItemR(col, ptr, "use_bokeh", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
uiItemR(col, ptr, "use_gamma_correction", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
uiItemR(col, ptr, "use_relative", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_boolean_get(ptr, "use_relative")) {
uiItemL(col, IFACE_("Aspect Correction"), ICON_NONE);
row = uiLayoutRow(layout, true);
uiItemR(row,
ptr,
"aspect_correction",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND,
nullptr,
ICON_NONE);
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "factor_x", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("X"), ICON_NONE);
uiItemR(col, ptr, "factor_y", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Y"), ICON_NONE);
}
else {
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "size_x", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("X"), ICON_NONE);
uiItemR(col, ptr, "size_y", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Y"), ICON_NONE);
}
uiItemR(col, ptr, "use_extended_bounds", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_blur()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_BLUR, "Blur", NODE_CLASS_OP_FILTER, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_blur_declare;
ntype.draw_buttons = node_composit_buts_blur;
node_type_init(&ntype, node_composit_init_blur);
node_type_storage(
&ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -22,6 +22,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "../node_composite_util.hh"
/* **************** BLUR ******************** */
@ -45,12 +48,21 @@ static void node_composit_init_bokehblur(bNodeTree *UNUSED(ntree), bNode *node)
node->custom4 = 16.0f;
}
static void node_composit_buts_bokehblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "use_variable_size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
// uiItemR(layout, ptr, "f_stop", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); /* UNUSED */
uiItemR(layout, ptr, "blur_max", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "use_extended_bounds", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_bokehblur()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_BOKEHBLUR, "Bokeh Blur", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_bokehblur_declare;
ntype.draw_buttons = node_composit_buts_bokehblur;
node_type_init(&ntype, node_composit_init_bokehblur);
nodeRegisterType(&ntype);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "../node_composite_util.hh"
/* **************** Bokeh image Tools ******************** */
@ -45,12 +48,28 @@ static void node_composit_init_bokehimage(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = data;
}
static void node_composit_buts_bokehimage(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "flaps", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "angle", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(
layout, ptr, "rounding", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(layout,
ptr,
"catadioptric",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(layout, ptr, "shift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
void register_node_type_cmp_bokehimage()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_BOKEHIMAGE, "Bokeh Image", NODE_CLASS_INPUT, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_bokehimage_declare;
ntype.draw_buttons = node_composit_buts_bokehimage;
node_type_init(&ntype, node_composit_init_bokehimage);
node_type_storage(
&ntype, "NodeBokehImage", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "../node_composite_util.hh"
/* **************** SCALAR MATH ******************** */
@ -47,12 +50,29 @@ static void node_composit_init_boxmask(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = data;
}
static void node_composit_buts_boxmask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *row;
row = uiLayoutRow(layout, true);
uiItemR(row, ptr, "x", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(row, ptr, "y", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
row = uiLayoutRow(layout, true);
uiItemR(row, ptr, "width", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(row, ptr, "height", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(layout, ptr, "rotation", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "mask_type", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_boxmask()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_MASK_BOX, "Box Mask", NODE_CLASS_MATTE, 0);
ntype.declare = blender::nodes::cmp_node_boxmask_declare;
ntype.draw_buttons = node_composit_buts_boxmask;
node_type_init(&ntype, node_composit_init_boxmask);
node_type_storage(&ntype, "NodeBoxMask", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Bright and Contrast ******************** */
@ -42,12 +45,20 @@ static void node_composit_init_brightcontrast(bNodeTree *UNUSED(ntree), bNode *n
node->custom1 = 1;
}
static void node_composit_buts_brightcontrast(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiItemR(layout, ptr, "use_premultiply", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_brightcontrast()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, 0);
ntype.declare = blender::nodes::cmp_node_brightcontrast_declare;
ntype.draw_buttons = node_composit_buts_brightcontrast;
node_type_init(&ntype, node_composit_init_brightcontrast);
nodeRegisterType(&ntype);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* Channel Matte Node ********************************* */
@ -51,6 +56,47 @@ static void node_composit_init_channel_matte(bNodeTree *UNUSED(ntree), bNode *no
node->custom2 = 2; /* Green Channel. */
}
static void node_composit_buts_channel_matte(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiLayout *col, *row;
uiItemL(layout, IFACE_("Color Space:"), ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemR(
row, ptr, "color_space", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
col = uiLayoutColumn(layout, false);
uiItemL(col, IFACE_("Key Channel:"), ICON_NONE);
row = uiLayoutRow(col, false);
uiItemR(row,
ptr,
"matte_channel",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND,
nullptr,
ICON_NONE);
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "limit_method", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_enum_get(ptr, "limit_method") == 0) {
uiItemL(col, IFACE_("Limiting Channel:"), ICON_NONE);
row = uiLayoutRow(col, false);
uiItemR(row,
ptr,
"limit_channel",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND,
nullptr,
ICON_NONE);
}
uiItemR(
col, ptr, "limit_max", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(
col, ptr, "limit_min", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
void register_node_type_cmp_channel_matte()
{
static bNodeType ntype;
@ -58,6 +104,7 @@ void register_node_type_cmp_channel_matte()
cmp_node_type_base(
&ntype, CMP_NODE_CHANNEL_MATTE, "Channel Key", NODE_CLASS_MATTE, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_channel_matte_declare;
ntype.draw_buttons = node_composit_buts_channel_matte;
node_type_init(&ntype, node_composit_init_channel_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* Chroma Key ********************************************************** */
@ -48,12 +51,29 @@ static void node_composit_init_chroma_matte(bNodeTree *UNUSED(ntree), bNode *nod
c->fstrength = 1.0f;
}
static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "tolerance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "threshold", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(layout, true);
/* Removed for now. */
// uiItemR(col, ptr, "lift", UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(col, ptr, "gain", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
/* Removed for now. */
// uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
void register_node_type_cmp_chroma_matte()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_CHROMA_MATTE, "Chroma Key", NODE_CLASS_MATTE, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_chroma_matte_declare;
ntype.draw_buttons = node_composit_buts_chroma_matte;
node_type_init(&ntype, node_composit_init_chroma_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* Color Matte ********************************************************** */
@ -48,12 +51,30 @@ static void node_composit_init_color_matte(bNodeTree *UNUSED(ntree), bNode *node
c->fstrength = 1.0f;
}
static void node_composit_buts_color_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, true);
uiItemR(
col, ptr, "color_hue", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(col,
ptr,
"color_saturation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(
col, ptr, "color_value", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
void register_node_type_cmp_color_matte()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_COLOR_MATTE, "Color Key", NODE_CLASS_MATTE, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_color_matte_declare;
ntype.draw_buttons = node_composit_buts_color_matte;
node_type_init(&ntype, node_composit_init_color_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* Color Spill Suppression ********************************* */
@ -47,12 +52,59 @@ static void node_composit_init_color_spill(bNodeTree *UNUSED(ntree), bNode *node
ncs->unspill = 0; /* do not use unspill */
}
static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *row, *col;
uiItemL(layout, IFACE_("Despill Channel:"), ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemR(row, ptr, "channel", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "limit_method", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_enum_get(ptr, "limit_method") == 0) {
uiItemL(col, IFACE_("Limiting Channel:"), ICON_NONE);
row = uiLayoutRow(col, false);
uiItemR(row,
ptr,
"limit_channel",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND,
nullptr,
ICON_NONE);
}
uiItemR(col, ptr, "ratio", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(col, ptr, "use_unspill", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_boolean_get(ptr, "use_unspill") == true) {
uiItemR(col,
ptr,
"unspill_red",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(col,
ptr,
"unspill_green",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(col,
ptr,
"unspill_blue",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
}
}
void register_node_type_cmp_color_spill()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_COLOR_SPILL, "Color Spill", NODE_CLASS_MATTE, 0);
ntype.declare = blender::nodes::cmp_node_color_spill_declare;
ntype.draw_buttons = node_composit_buts_color_spill;
node_type_init(&ntype, node_composit_init_color_spill);
node_type_storage(
&ntype, "NodeColorspill", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* Color Balance ********************************* */
@ -79,12 +84,88 @@ static void node_composit_init_colorbalance(bNodeTree *UNUSED(ntree), bNode *nod
node->storage = n;
}
static void node_composit_buts_colorbalance(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *split, *col, *row;
uiItemR(layout, ptr, "correction_method", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_enum_get(ptr, "correction_method") == 0) {
split = uiLayoutSplit(layout, 0.0f, false);
col = uiLayoutColumn(split, false);
uiTemplateColorPicker(col, ptr, "lift", true, true, false, true);
row = uiLayoutRow(col, false);
uiItemR(row, ptr, "lift", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(split, false);
uiTemplateColorPicker(col, ptr, "gamma", true, true, true, true);
row = uiLayoutRow(col, false);
uiItemR(row, ptr, "gamma", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(split, false);
uiTemplateColorPicker(col, ptr, "gain", true, true, true, true);
row = uiLayoutRow(col, false);
uiItemR(row, ptr, "gain", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
else {
split = uiLayoutSplit(layout, 0.0f, false);
col = uiLayoutColumn(split, false);
uiTemplateColorPicker(col, ptr, "offset", true, true, false, true);
row = uiLayoutRow(col, false);
uiItemR(row, ptr, "offset", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "offset_basis", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(split, false);
uiTemplateColorPicker(col, ptr, "power", true, true, false, true);
row = uiLayoutRow(col, false);
uiItemR(row, ptr, "power", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(split, false);
uiTemplateColorPicker(col, ptr, "slope", true, true, false, true);
row = uiLayoutRow(col, false);
uiItemR(row, ptr, "slope", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
}
static void node_composit_buts_colorbalance_ex(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiItemR(layout, ptr, "correction_method", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_enum_get(ptr, "correction_method") == 0) {
uiTemplateColorPicker(layout, ptr, "lift", true, true, false, true);
uiItemR(layout, ptr, "lift", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiTemplateColorPicker(layout, ptr, "gamma", true, true, true, true);
uiItemR(layout, ptr, "gamma", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiTemplateColorPicker(layout, ptr, "gain", true, true, true, true);
uiItemR(layout, ptr, "gain", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
else {
uiTemplateColorPicker(layout, ptr, "offset", true, true, false, true);
uiItemR(layout, ptr, "offset", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiTemplateColorPicker(layout, ptr, "power", true, true, false, true);
uiItemR(layout, ptr, "power", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiTemplateColorPicker(layout, ptr, "slope", true, true, false, true);
uiItemR(layout, ptr, "slope", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
}
void register_node_type_cmp_colorbalance()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_COLORBALANCE, "Color Balance", NODE_CLASS_OP_COLOR, 0);
ntype.declare = blender::nodes::cmp_node_colorbalance_declare;
ntype.draw_buttons = node_composit_buts_colorbalance;
ntype.draw_buttons_ex = node_composit_buts_colorbalance_ex;
node_type_size(&ntype, 400, 200, 400);
node_type_init(&ntype, node_composit_init_colorbalance);
node_type_storage(

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* Color Correction ********************************* */
@ -66,12 +69,230 @@ static void node_composit_init_colorcorrection(bNodeTree *UNUSED(ntree), bNode *
node->storage = n;
}
static void node_composit_buts_colorcorrection(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiLayout *row;
row = uiLayoutRow(layout, false);
uiItemR(row, ptr, "red", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(row, ptr, "green", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(row, ptr, "blue", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemL(row, "", ICON_NONE);
uiItemL(row, IFACE_("Saturation"), ICON_NONE);
uiItemL(row, IFACE_("Contrast"), ICON_NONE);
uiItemL(row, IFACE_("Gamma"), ICON_NONE);
uiItemL(row, IFACE_("Gain"), ICON_NONE);
uiItemL(row, IFACE_("Lift"), ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemL(row, IFACE_("Master"), ICON_NONE);
uiItemR(
row, ptr, "master_saturation", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(
row, ptr, "master_contrast", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(row, ptr, "master_gain", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(row, ptr, "master_lift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemL(row, IFACE_("Highlights"), ICON_NONE);
uiItemR(row,
ptr,
"highlights_saturation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
"",
ICON_NONE);
uiItemR(row,
ptr,
"highlights_contrast",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
"",
ICON_NONE);
uiItemR(
row, ptr, "highlights_gamma", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(
row, ptr, "highlights_gain", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(
row, ptr, "highlights_lift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemL(row, IFACE_("Midtones"), ICON_NONE);
uiItemR(row,
ptr,
"midtones_saturation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
"",
ICON_NONE);
uiItemR(
row, ptr, "midtones_contrast", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(
row, ptr, "midtones_gamma", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(row, ptr, "midtones_gain", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemL(row, IFACE_("Shadows"), ICON_NONE);
uiItemR(row,
ptr,
"shadows_saturation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
"",
ICON_NONE);
uiItemR(
row, ptr, "shadows_contrast", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(row, ptr, "shadows_gain", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
uiItemR(row, ptr, "shadows_lift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, "", ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemR(row,
ptr,
"midtones_start",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(
row, ptr, "midtones_end", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
static void node_composit_buts_colorcorrection_ex(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiLayout *row;
row = uiLayoutRow(layout, false);
uiItemR(row, ptr, "red", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(row, ptr, "green", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(row, ptr, "blue", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
row = layout;
uiItemL(row, IFACE_("Saturation"), ICON_NONE);
uiItemR(row,
ptr,
"master_saturation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"highlights_saturation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"midtones_saturation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"shadows_saturation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemL(row, IFACE_("Contrast"), ICON_NONE);
uiItemR(row,
ptr,
"master_contrast",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"highlights_contrast",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"midtones_contrast",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"shadows_contrast",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemL(row, IFACE_("Gamma"), ICON_NONE);
uiItemR(
row, ptr, "master_gamma", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(row,
ptr,
"highlights_gamma",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"midtones_gamma",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"shadows_gamma",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemL(row, IFACE_("Gain"), ICON_NONE);
uiItemR(
row, ptr, "master_gain", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(row,
ptr,
"highlights_gain",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"midtones_gain",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(
row, ptr, "shadows_gain", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemL(row, IFACE_("Lift"), ICON_NONE);
uiItemR(
row, ptr, "master_lift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(row,
ptr,
"highlights_lift",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(row,
ptr,
"midtones_lift",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
uiItemR(
row, ptr, "shadows_lift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemR(row, ptr, "midtones_start", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(row, ptr, "midtones_end", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_colorcorrection()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_COLORCORRECTION, "Color Correction", NODE_CLASS_OP_COLOR, 0);
ntype.declare = blender::nodes::cmp_node_colorcorrection_declare;
ntype.draw_buttons = node_composit_buts_colorcorrection;
ntype.draw_buttons_ex = node_composit_buts_colorcorrection_ex;
node_type_size(&ntype, 400, 200, 600);
node_type_init(&ntype, node_composit_init_colorcorrection);
node_type_storage(

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** COMPOSITE ******************** */
@ -36,13 +39,18 @@ static void cmp_node_composite_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_composite(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "use_alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_composite()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_COMPOSITE, "Composite", NODE_CLASS_OUTPUT, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_composite_declare;
ntype.draw_buttons = node_composit_buts_composite;
ntype.no_muting = true;
nodeRegisterType(&ntype);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Crop ******************** */
@ -45,12 +50,35 @@ static void node_composit_init_crop(bNodeTree *UNUSED(ntree), bNode *node)
nxy->y2 = 0;
}
static void node_composit_buts_crop(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
uiItemR(layout, ptr, "use_crop_size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "relative", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(layout, true);
if (RNA_boolean_get(ptr, "relative")) {
uiItemR(col, ptr, "rel_min_x", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Left"), ICON_NONE);
uiItemR(col, ptr, "rel_max_x", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Right"), ICON_NONE);
uiItemR(col, ptr, "rel_min_y", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Up"), ICON_NONE);
uiItemR(col, ptr, "rel_max_y", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Down"), ICON_NONE);
}
else {
uiItemR(col, ptr, "min_x", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Left"), ICON_NONE);
uiItemR(col, ptr, "max_x", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Right"), ICON_NONE);
uiItemR(col, ptr, "min_y", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Up"), ICON_NONE);
uiItemR(col, ptr, "max_y", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Down"), ICON_NONE);
}
}
void register_node_type_cmp_crop()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_CROP, "Crop", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_crop_declare;
ntype.draw_buttons = node_composit_buts_crop;
node_type_init(&ntype, node_composit_init_crop);
node_type_storage(&ntype, "NodeTwoXYs", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** CURVE Time ******************** */
@ -72,12 +75,18 @@ static void node_composit_init_curve_vec(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = BKE_curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f);
}
static void node_buts_curvevec(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiTemplateCurveMapping(layout, ptr, "mapping", 'v', false, false, false, false);
}
void register_node_type_cmp_curve_vec()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, 0);
ntype.declare = blender::nodes::cmp_node_curve_vec_declare;
ntype.draw_buttons = node_buts_curvevec;
node_type_size(&ntype, 200, 140, 320);
node_type_init(&ntype, node_composit_init_curve_vec);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);

View File

@ -21,10 +21,15 @@
* \ingroup cmpnodes
*/
#include "node_composite_util.hh"
#include <climits>
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ************ Defocus Node ****************** */
namespace blender::nodes {
@ -55,12 +60,52 @@ static void node_composit_init_defocus(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = nbd;
}
static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
uiLayout *sub, *col;
col = uiLayoutColumn(layout, false);
uiItemL(col, IFACE_("Bokeh Type:"), ICON_NONE);
uiItemR(col, ptr, "bokeh", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
uiItemR(col, ptr, "angle", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "use_gamma_correction", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(layout, false);
uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_zbuffer") == true);
uiItemR(col, ptr, "f_stop", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "blur_max", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "threshold", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "use_preview", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiTemplateID(layout,
C,
ptr,
"scene",
nullptr,
nullptr,
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "use_zbuffer", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
sub = uiLayoutColumn(col, false);
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_zbuffer") == false);
uiItemR(sub, ptr, "z_scale", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_defocus()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_DEFOCUS, "Defocus", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_defocus_declare;
ntype.draw_buttons = node_composit_buts_defocus;
node_type_init(&ntype, node_composit_init_defocus);
node_type_storage(&ntype, "NodeDefocus", node_free_standard_storage, node_copy_standard_storage);

View File

@ -23,6 +23,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
@ -49,12 +52,31 @@ static void node_composit_init_denonise(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = ndg;
}
static void node_composit_buts_denoise(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
#ifndef WITH_OPENIMAGEDENOISE
uiItemL(layout, IFACE_("Disabled, built without OpenImageDenoise"), ICON_ERROR);
#else
/* Always supported through Accelerate framework BNNS on macOS. */
# ifndef __APPLE__
if (!BLI_cpu_support_sse41()) {
uiItemL(layout, IFACE_("Disabled, CPU with SSE4.1 is required"), ICON_ERROR);
}
# endif
#endif
uiItemL(layout, IFACE_("Prefilter:"), ICON_NONE);
uiItemR(layout, ptr, "prefilter", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "use_hdr", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_denoise()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_DENOISE, "Denoise", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_denoise_declare;
ntype.draw_buttons = node_composit_buts_denoise;
node_type_init(&ntype, node_composit_init_denonise);
node_type_storage(&ntype, "NodeDenoise", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** FILTER ******************** */
@ -42,12 +45,22 @@ static void node_composit_init_despeckle(bNodeTree *UNUSED(ntree), bNode *node)
node->custom4 = 0.5f;
}
static void node_composit_buts_despeckle(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "threshold", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "threshold_neighbor", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_despeckle()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_DESPECKLE, "Despeckle", NODE_CLASS_OP_FILTER, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_despeckle_declare;
ntype.draw_buttons = node_composit_buts_despeckle;
node_type_init(&ntype, node_composit_init_despeckle);
nodeRegisterType(&ntype);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* channel Difference Matte ********************************* */
@ -45,6 +48,16 @@ static void node_composit_init_diff_matte(bNodeTree *UNUSED(ntree), bNode *node)
c->t2 = 0.1f;
}
static void node_composit_buts_diff_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, true);
uiItemR(
col, ptr, "tolerance", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(col, ptr, "falloff", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
void register_node_type_cmp_diff_matte()
{
static bNodeType ntype;
@ -52,6 +65,7 @@ void register_node_type_cmp_diff_matte()
cmp_node_type_base(
&ntype, CMP_NODE_DIFF_MATTE, "Difference Key", NODE_CLASS_MATTE, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_diff_matte_declare;
ntype.draw_buttons = node_composit_buts_diff_matte;
node_type_init(&ntype, node_composit_init_diff_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Dilate/Erode ******************** */
@ -43,11 +48,26 @@ static void node_composit_init_dilateerode(bNodeTree *UNUSED(ntree), bNode *node
node->storage = data;
}
static void node_composit_buts_dilateerode(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "mode", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "distance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
switch (RNA_enum_get(ptr, "mode")) {
case CMP_NODE_DILATEERODE_DISTANCE_THRESH:
uiItemR(layout, ptr, "edge", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
break;
case CMP_NODE_DILATEERODE_DISTANCE_FEATHER:
uiItemR(layout, ptr, "falloff", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
break;
}
}
void register_node_type_cmp_dilateerode()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_DILATEERODE, "Dilate/Erode", NODE_CLASS_OP_FILTER, 0);
ntype.draw_buttons = node_composit_buts_dilateerode;
ntype.declare = blender::nodes::cmp_node_dilate_declare;
node_type_init(&ntype, node_composit_init_dilateerode);
node_type_storage(

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
@ -42,12 +45,37 @@ static void node_composit_init_dblur(bNodeTree *UNUSED(ntree), bNode *node)
ndbd->center_y = 0.5;
}
static void node_composit_buts_dblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
uiItemR(layout, ptr, "iterations", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "use_wrap", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(layout, true);
uiItemL(col, IFACE_("Center:"), ICON_NONE);
uiItemR(col, ptr, "center_x", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("X"), ICON_NONE);
uiItemR(col, ptr, "center_y", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Y"), ICON_NONE);
uiItemS(layout);
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "distance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "angle", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemS(layout);
uiItemR(layout, ptr, "spin", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "zoom", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_dblur()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_DBLUR, "Directional Blur", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_directional_blur_declare;
ntype.draw_buttons = node_composit_buts_dblur;
node_type_init(&ntype, node_composit_init_dblur);
node_type_storage(
&ntype, "NodeDBlurData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* channel Distance Matte ********************************* */
@ -46,12 +49,30 @@ static void node_composit_init_distance_matte(bNodeTree *UNUSED(ntree), bNode *n
c->t2 = 0.1f;
}
static void node_composit_buts_distance_matte(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiLayout *col, *row;
col = uiLayoutColumn(layout, true);
uiItemL(layout, IFACE_("Color Space:"), ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemR(row, ptr, "channel", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
uiItemR(
col, ptr, "tolerance", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(col, ptr, "falloff", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
void register_node_type_cmp_distance_matte()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_DIST_MATTE, "Distance Key", NODE_CLASS_MATTE, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_distance_matte_declare;
ntype.draw_buttons = node_composit_buts_distance_matte;
node_type_init(&ntype, node_composit_init_distance_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);

View File

@ -20,6 +20,10 @@
/** \file
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Double Edge Mask ******************** */
@ -35,12 +39,27 @@ static void cmp_node_double_edge_mask_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_double_edge_mask(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, false);
uiItemL(col, IFACE_("Inner Edge:"), ICON_NONE);
uiItemR(col, ptr, "inner_mode", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
uiItemL(col, IFACE_("Buffer Edge:"), ICON_NONE);
uiItemR(col, ptr, "edge_mode", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_doubleedgemask()
{
static bNodeType ntype; /* Allocate a node type data structure. */
cmp_node_type_base(&ntype, CMP_NODE_DOUBLEEDGEMASK, "Double Edge Mask", NODE_CLASS_MATTE, 0);
ntype.declare = blender::nodes::cmp_node_double_edge_mask_declare;
ntype.draw_buttons = node_composit_buts_double_edge_mask;
nodeRegisterType(&ntype);
}

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "../node_composite_util.hh"
/* **************** SCALAR MATH ******************** */
@ -48,12 +51,27 @@ static void node_composit_init_ellipsemask(bNodeTree *UNUSED(ntree), bNode *node
node->storage = data;
}
static void node_composit_buts_ellipsemask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *row;
row = uiLayoutRow(layout, true);
uiItemR(row, ptr, "x", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(row, ptr, "y", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
row = uiLayoutRow(layout, true);
uiItemR(row, ptr, "width", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(row, ptr, "height", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(layout, ptr, "rotation", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "mask_type", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_ellipsemask()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_MASK_ELLIPSE, "Ellipse Mask", NODE_CLASS_MATTE, 0);
ntype.declare = blender::nodes::cmp_node_ellipsemask_declare;
ntype.draw_buttons = node_composit_buts_ellipsemask;
node_type_size(&ntype, 260, 110, 320);
node_type_init(&ntype, node_composit_init_ellipsemask);
node_type_storage(

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** FILTER ******************** */
@ -36,12 +39,18 @@ static void cmp_node_filter_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_filter(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "filter_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_filter()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_FILTER, "Filter", NODE_CLASS_OP_FILTER, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_filter_declare;
ntype.draw_buttons = node_composit_buts_filter;
ntype.labelfunc = node_filter_label;
nodeRegisterType(&ntype);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Flip ******************** */
@ -35,12 +38,18 @@ static void cmp_node_flip_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_flip(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "axis", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_flip()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_FLIP, "Flip", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_flip_declare;
ntype.draw_buttons = node_composit_buts_flip;
nodeRegisterType(&ntype);
}

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
@ -50,12 +55,51 @@ static void node_composit_init_glare(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = ndg;
}
static void node_composit_buts_glare(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "glare_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
uiItemR(layout, ptr, "quality", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
if (RNA_enum_get(ptr, "glare_type") != 1) {
uiItemR(layout, ptr, "iterations", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_enum_get(ptr, "glare_type") != 0) {
uiItemR(layout,
ptr,
"color_modulation",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
}
}
uiItemR(layout, ptr, "mix", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "threshold", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_enum_get(ptr, "glare_type") == 2) {
uiItemR(layout, ptr, "streaks", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "angle_offset", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
if (RNA_enum_get(ptr, "glare_type") == 0 || RNA_enum_get(ptr, "glare_type") == 2) {
uiItemR(
layout, ptr, "fade", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
if (RNA_enum_get(ptr, "glare_type") == 0) {
uiItemR(layout, ptr, "use_rotate_45", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
}
if (RNA_enum_get(ptr, "glare_type") == 1) {
uiItemR(layout, ptr, "size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
}
void register_node_type_cmp_glare()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_GLARE, "Glare", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_glare_declare;
ntype.draw_buttons = node_composit_buts_glare;
node_type_init(&ntype, node_composit_init_glare);
node_type_storage(&ntype, "NodeGlare", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** ID Mask ******************** */
@ -35,12 +38,19 @@ static void cmp_node_idmask_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "index", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "use_antialiasing", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_idmask()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_ID_MASK, "ID Mask", NODE_CLASS_CONVERTER, 0);
ntype.declare = blender::nodes::cmp_node_idmask_declare;
ntype.draw_buttons = node_composit_buts_id_mask;
nodeRegisterType(&ntype);
}

View File

@ -26,16 +26,21 @@
#include "BLI_linklist.h"
#include "BLI_utildefines.h"
#include "DNA_scene_types.h"
#include "RE_engine.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_scene.h"
#include "DNA_scene_types.h"
#include "RE_engine.h"
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
/* **************** IMAGE (and RenderResult, multilayer image) ******************** */
static bNodeSocketTemplate cmp_node_rlayers_out[] = {
@ -555,12 +560,56 @@ static void cmp_node_rlayers_update(bNodeTree *ntree, bNode *node)
cmp_node_update_default(ntree, node);
}
static void node_composit_buts_viewlayers(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
uiLayout *col, *row;
uiTemplateID(layout,
C,
ptr,
"scene",
nullptr,
nullptr,
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
if (!node->id) {
return;
}
col = uiLayoutColumn(layout, false);
row = uiLayoutRow(col, true);
uiItemR(row, ptr, "layer", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
PropertyRNA *prop = RNA_struct_find_property(ptr, "layer");
const char *layer_name;
if (!(RNA_property_enum_identifier(
C, ptr, prop, RNA_property_enum_get(ptr, prop), &layer_name))) {
return;
}
PointerRNA scn_ptr;
char scene_name[MAX_ID_NAME - 2];
scn_ptr = RNA_pointer_get(ptr, "scene");
RNA_string_get(&scn_ptr, "name", scene_name);
PointerRNA op_ptr;
uiItemFullO(
row, "RENDER_OT_render", "", ICON_RENDER_STILL, nullptr, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
RNA_string_set(&op_ptr, "layer", layer_name);
RNA_string_set(&op_ptr, "scene", scene_name);
}
void register_node_type_cmp_rlayers()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_R_LAYERS, "Render Layers", NODE_CLASS_INPUT, NODE_PREVIEW);
node_type_socket_templates(&ntype, nullptr, cmp_node_rlayers_out);
ntype.draw_buttons = node_composit_buts_viewlayers;
ntype.initfunc_api = node_composit_init_rlayers;
ntype.poll = node_composit_poll_rlayers;
node_type_storage(&ntype, nullptr, node_composit_free_rlayers, node_composit_copy_rlayers);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Inpaint/ ******************** */
@ -35,12 +38,18 @@ static void cmp_node_inpaint_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_inpaint(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "distance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_inpaint()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_INPAINT, "Inpaint", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_inpaint_declare;
ntype.draw_buttons = node_composit_buts_inpaint;
nodeRegisterType(&ntype);
}

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** INVERT ******************** */
@ -41,6 +44,15 @@ static void node_composit_init_invert(bNodeTree *UNUSED(ntree), bNode *node)
node->custom1 |= CMP_CHAN_RGB;
}
static void node_composit_buts_invert(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "invert_rgb", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "invert_alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
/* custom1 = mix type */
void register_node_type_cmp_invert()
{
@ -48,6 +60,7 @@ void register_node_type_cmp_invert()
cmp_node_type_base(&ntype, CMP_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, 0);
ntype.declare = blender::nodes::cmp_node_invert_declare;
ntype.draw_buttons = node_composit_buts_invert;
node_type_init(&ntype, node_composit_init_invert);
nodeRegisterType(&ntype);

View File

@ -21,11 +21,14 @@
* \ingroup cmpnodes
*/
#include "BLI_math_base.h"
#include "BLT_translation.h"
#include "DNA_movieclip_types.h"
#include "BLI_math_base.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
@ -60,12 +63,31 @@ static void node_composit_init_keying(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = data;
}
static void node_composit_buts_keying(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
/* bNode *node = (bNode*)ptr->data; */ /* UNUSED */
uiItemR(layout, ptr, "blur_pre", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "screen_balance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "despill_factor", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "despill_balance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "edge_kernel_radius", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "edge_kernel_tolerance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "clip_black", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "clip_white", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "dilate_distance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "feather_falloff", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "feather_distance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "blur_post", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_keying()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_KEYING, "Keying", NODE_CLASS_MATTE, 0);
ntype.declare = blender::nodes::cmp_node_keying_declare;
ntype.draw_buttons = node_composit_buts_keying;
node_type_init(&ntype, node_composit_init_keying);
node_type_storage(
&ntype, "NodeKeyingData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -26,6 +26,11 @@
#include "BLI_math_base.h"
#include "BLI_math_color.h"
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Keying Screen ******************** */
@ -46,12 +51,40 @@ static void node_composit_init_keyingscreen(bNodeTree *UNUSED(ntree), bNode *nod
node->storage = data;
}
static void node_composit_buts_keyingscreen(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
uiTemplateID(layout,
C,
ptr,
"clip",
nullptr,
nullptr,
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
if (node->id) {
MovieClip *clip = (MovieClip *)node->id;
uiLayout *col;
PointerRNA tracking_ptr;
RNA_pointer_create(&clip->id, &RNA_MovieTracking, &clip->tracking, &tracking_ptr);
col = uiLayoutColumn(layout, true);
uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
}
}
void register_node_type_cmp_keyingscreen()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_KEYINGSCREEN, "Keying Screen", NODE_CLASS_MATTE, 0);
ntype.declare = blender::nodes::cmp_node_keyingscreen_declare;
ntype.draw_buttons = node_composit_buts_keyingscreen;
node_type_init(&ntype, node_composit_init_keyingscreen);
node_type_storage(
&ntype, "NodeKeyingScreenData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
@ -42,12 +47,26 @@ static void node_composit_init_lensdist(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = nld;
}
static void node_composit_buts_lensdist(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "use_projector", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(col, false);
uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_projector") == false);
uiItemR(col, ptr, "use_jitter", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "use_fit", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_lensdist()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_LENSDIST, "Lens Distortion", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_lensdist_declare;
ntype.draw_buttons = node_composit_buts_lensdist;
node_type_init(&ntype, node_composit_init_lensdist);
node_type_storage(
&ntype, "NodeLensDist", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** LEVELS ******************** */
@ -41,12 +44,18 @@ static void node_composit_init_view_levels(bNodeTree *UNUSED(ntree), bNode *node
node->custom1 = 1; /* All channels. */
}
static void node_composit_buts_view_levels(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "channel", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_view_levels()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_VIEW_LEVELS, "Levels", NODE_CLASS_OUTPUT, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_levels_declare;
ntype.draw_buttons = node_composit_buts_view_levels;
node_type_init(&ntype, node_composit_init_view_levels);
nodeRegisterType(&ntype);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* ******************* Luma Matte Node ********************************* */
@ -44,12 +47,24 @@ static void node_composit_init_luma_matte(bNodeTree *UNUSED(ntree), bNode *node)
c->t2 = 0.0f;
}
static void node_composit_buts_luma_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, true);
uiItemR(
col, ptr, "limit_max", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(
col, ptr, "limit_min", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
void register_node_type_cmp_luma_matte()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_LUMA_MATTE, "Luminance Key", NODE_CLASS_MATTE, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_luma_matte_declare;
ntype.draw_buttons = node_composit_buts_luma_matte;
node_type_init(&ntype, node_composit_init_luma_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Map Range ******************** */
@ -39,12 +42,21 @@ static void cmp_node_map_range_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_map_range(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "use_clamp", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_map_range()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_MAP_RANGE, "Map Range", NODE_CLASS_OP_VECTOR, 0);
ntype.declare = blender::nodes::cmp_node_map_range_declare;
ntype.draw_buttons = node_composit_buts_map_range;
nodeRegisterType(&ntype);
}

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Map UV ******************** */
@ -36,12 +39,18 @@ static void cmp_node_map_uv_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_map_uv(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_mapuv()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_MAP_UV, "Map UV", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_map_uv_declare;
ntype.draw_buttons = node_composit_buts_map_uv;
nodeRegisterType(&ntype);
}

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** MAP VALUE ******************** */
@ -40,12 +45,34 @@ static void node_composit_init_map_value(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = BKE_texture_mapping_add(TEXMAP_TYPE_POINT);
}
static void node_composit_buts_map_value(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *sub, *col;
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "offset", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "use_min", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
sub = uiLayoutColumn(col, false);
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min"));
uiItemR(sub, ptr, "min", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "use_max", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
sub = uiLayoutColumn(col, false);
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max"));
uiItemR(sub, ptr, "max", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_map_value()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR, 0);
ntype.declare = blender::nodes::cmp_node_map_value_declare;
ntype.draw_buttons = node_composit_buts_map_value;
node_type_init(&ntype, node_composit_init_map_value);
node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage);

View File

@ -23,6 +23,9 @@
#include "DNA_mask_types.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Mask ******************** */
@ -59,12 +62,43 @@ static void node_mask_label(const bNodeTree *UNUSED(ntree),
}
}
static void node_composit_buts_mask(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
uiTemplateID(layout,
C,
ptr,
"mask",
nullptr,
nullptr,
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
uiItemR(layout, ptr, "use_feather", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "size_source", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
if (node->custom1 & (CMP_NODEFLAG_MASK_FIXED | CMP_NODEFLAG_MASK_FIXED_SCENE)) {
uiItemR(layout, ptr, "size_x", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "size_y", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
uiItemR(layout, ptr, "use_motion_blur", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (node->custom1 & CMP_NODEFLAG_MASK_MOTION_BLUR) {
uiItemR(layout, ptr, "motion_blur_samples", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "motion_blur_shutter", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
}
void register_node_type_cmp_mask()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_MASK, "Mask", NODE_CLASS_INPUT, 0);
ntype.declare = blender::nodes::cmp_node_mask_declare;
ntype.draw_buttons = node_composit_buts_mask;
node_type_init(&ntype, node_composit_init_mask);
ntype.labelfunc = node_mask_label;

View File

@ -21,11 +21,16 @@
* \ingroup cmpnodes
*/
#include "node_composite_util.hh"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
static void cmp_node_movieclip_declare(NodeDeclarationBuilder &b)
@ -53,12 +58,53 @@ static void init(const bContext *C, PointerRNA *ptr)
user->framenr = 1;
}
static void node_composit_buts_movieclip(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
uiTemplateID(layout,
C,
ptr,
"clip",
nullptr,
"CLIP_OT_open",
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
}
static void node_composit_buts_movieclip_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
PointerRNA clipptr;
uiTemplateID(layout,
C,
ptr,
"clip",
nullptr,
"CLIP_OT_open",
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
if (!node->id) {
return;
}
clipptr = RNA_pointer_get(ptr, "clip");
uiTemplateColorspaceSettings(layout, &clipptr, "colorspace_settings");
}
void register_node_type_cmp_movieclip()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_MOVIECLIP, "Movie Clip", NODE_CLASS_INPUT, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_movieclip_declare;
ntype.draw_buttons = node_composit_buts_movieclip;
ntype.draw_buttons_ex = node_composit_buts_movieclip_ex;
ntype.initfunc_api = init;
node_type_storage(
&ntype, "MovieClipUser", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,11 +21,14 @@
* \ingroup cmpnodes
*/
#include "node_composite_util.hh"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Translate ******************** */
namespace blender::nodes {
@ -73,14 +76,36 @@ static void storage_copy(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const
}
}
static void node_composit_buts_moviedistortion(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
uiTemplateID(layout,
C,
ptr,
"clip",
nullptr,
"CLIP_OT_open",
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
if (!node->id) {
return;
}
uiItemR(layout, ptr, "distortion_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_moviedistortion()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_MOVIEDISTORTION, "Movie Distortion", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_moviedistortion_declare;
ntype.draw_buttons = node_composit_buts_moviedistortion;
ntype.labelfunc = label;
ntype.initfunc_api = init;
node_type_storage(&ntype, nullptr, storage_free, storage_copy);

View File

@ -31,6 +31,11 @@
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "node_composite_util.hh"
#include "intern/openexr/openexr_multi.h"
@ -277,12 +282,169 @@ static void update_output_file(bNodeTree *ntree, bNode *node)
}
}
static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
PointerRNA imfptr = RNA_pointer_get(ptr, "format");
const bool multilayer = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER;
if (multilayer) {
uiItemL(layout, IFACE_("Path:"), ICON_NONE);
}
else {
uiItemL(layout, IFACE_("Base Path:"), ICON_NONE);
}
uiItemR(layout, ptr, "base_path", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
Scene *scene = CTX_data_scene(C);
PointerRNA imfptr = RNA_pointer_get(ptr, "format");
PointerRNA active_input_ptr, op_ptr;
uiLayout *row, *col;
const bool multilayer = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER;
const bool is_exr = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_OPENEXR;
const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0;
node_composit_buts_file_output(layout, C, ptr);
uiTemplateImageSettings(layout, &imfptr, false);
/* disable stereo output for multilayer, too much work for something that no one will use */
/* if someone asks for that we can implement it */
if (is_multiview) {
uiTemplateImageFormatViews(layout, &imfptr, nullptr);
}
uiItemS(layout);
uiItemO(layout, IFACE_("Add Input"), ICON_ADD, "NODE_OT_output_file_add_socket");
row = uiLayoutRow(layout, false);
col = uiLayoutColumn(row, true);
const int active_index = RNA_int_get(ptr, "active_input_index");
/* using different collection properties if multilayer format is enabled */
if (multilayer) {
uiTemplateList(col,
C,
"UI_UL_list",
"file_output_node",
ptr,
"layer_slots",
ptr,
"active_input_index",
nullptr,
0,
0,
0,
0,
UI_TEMPLATE_LIST_FLAG_NONE);
RNA_property_collection_lookup_int(
ptr, RNA_struct_find_property(ptr, "layer_slots"), active_index, &active_input_ptr);
}
else {
uiTemplateList(col,
C,
"UI_UL_list",
"file_output_node",
ptr,
"file_slots",
ptr,
"active_input_index",
nullptr,
0,
0,
0,
0,
UI_TEMPLATE_LIST_FLAG_NONE);
RNA_property_collection_lookup_int(
ptr, RNA_struct_find_property(ptr, "file_slots"), active_index, &active_input_ptr);
}
/* XXX collection lookup does not return the ID part of the pointer,
* setting this manually here */
active_input_ptr.owner_id = ptr->owner_id;
col = uiLayoutColumn(row, true);
wmOperatorType *ot = WM_operatortype_find("NODE_OT_output_file_move_active_socket", false);
uiItemFullO_ptr(col, ot, "", ICON_TRIA_UP, nullptr, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
RNA_enum_set(&op_ptr, "direction", 1);
uiItemFullO_ptr(col, ot, "", ICON_TRIA_DOWN, nullptr, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
RNA_enum_set(&op_ptr, "direction", 2);
if (active_input_ptr.data) {
if (multilayer) {
col = uiLayoutColumn(layout, true);
uiItemL(col, IFACE_("Layer:"), ICON_NONE);
row = uiLayoutRow(col, false);
uiItemR(row, &active_input_ptr, "name", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
uiItemFullO(row,
"NODE_OT_output_file_remove_active_socket",
"",
ICON_X,
nullptr,
WM_OP_EXEC_DEFAULT,
UI_ITEM_R_ICON_ONLY,
nullptr);
}
else {
col = uiLayoutColumn(layout, true);
uiItemL(col, IFACE_("File Subpath:"), ICON_NONE);
row = uiLayoutRow(col, false);
uiItemR(row, &active_input_ptr, "path", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
uiItemFullO(row,
"NODE_OT_output_file_remove_active_socket",
"",
ICON_X,
nullptr,
WM_OP_EXEC_DEFAULT,
UI_ITEM_R_ICON_ONLY,
nullptr);
/* format details for individual files */
imfptr = RNA_pointer_get(&active_input_ptr, "format");
col = uiLayoutColumn(layout, true);
uiItemL(col, IFACE_("Format:"), ICON_NONE);
uiItemR(col,
&active_input_ptr,
"use_node_format",
UI_ITEM_R_SPLIT_EMPTY_NAME,
nullptr,
ICON_NONE);
const bool is_socket_exr = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_OPENEXR;
const bool use_node_format = RNA_boolean_get(&active_input_ptr, "use_node_format");
if ((!is_exr && use_node_format) || (!is_socket_exr && !use_node_format)) {
uiItemR(col,
&active_input_ptr,
"save_as_render",
UI_ITEM_R_SPLIT_EMPTY_NAME,
nullptr,
ICON_NONE);
}
col = uiLayoutColumn(layout, false);
uiLayoutSetActive(col, use_node_format == false);
uiTemplateImageSettings(col, &imfptr, false);
if (is_multiview) {
uiTemplateImageFormatViews(layout, &imfptr, nullptr);
}
}
}
}
void register_node_type_cmp_output_file()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_PREVIEW);
node_type_socket_templates(&ntype, nullptr, nullptr);
ntype.draw_buttons = node_composit_buts_file_output;
ntype.draw_buttons_ex = node_composit_buts_file_output_ex;
ntype.initfunc_api = init_output_file;
node_type_storage(&ntype, "NodeImageMultiFile", free_output_file, copy_output_file);
node_type_update(&ntype, update_output_file);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
@ -43,6 +48,55 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = data;
}
static void node_composit_buts_planetrackdeform(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *)node->storage;
uiTemplateID(layout,
C,
ptr,
"clip",
nullptr,
"CLIP_OT_open",
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
if (node->id) {
MovieClip *clip = (MovieClip *)node->id;
MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *object;
uiLayout *col;
PointerRNA tracking_ptr;
RNA_pointer_create(&clip->id, &RNA_MovieTracking, tracking, &tracking_ptr);
col = uiLayoutColumn(layout, false);
uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
object = BKE_tracking_object_get_named(tracking, data->tracking_object);
if (object) {
PointerRNA object_ptr;
RNA_pointer_create(&clip->id, &RNA_MovieTrackingObject, object, &object_ptr);
uiItemPointerR(
col, ptr, "plane_track_name", &object_ptr, "plane_tracks", "", ICON_ANIM_DATA);
}
else {
uiItemR(layout, ptr, "plane_track_name", 0, "", ICON_ANIM_DATA);
}
}
uiItemR(layout, ptr, "use_motion_blur", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (data->flag & CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR) {
uiItemR(layout, ptr, "motion_blur_samples", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "motion_blur_shutter", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
}
void register_node_type_cmp_planetrackdeform()
{
static bNodeType ntype;
@ -50,6 +104,7 @@ void register_node_type_cmp_planetrackdeform()
cmp_node_type_base(
&ntype, CMP_NODE_PLANETRACKDEFORM, "Plane Track Deform", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_planetrackdeform_declare;
ntype.draw_buttons = node_composit_buts_planetrackdeform;
node_type_init(&ntype, init);
node_type_storage(
&ntype, "NodePlaneTrackDeformData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Premul and Key Alpha Convert ******************** */
@ -35,12 +38,18 @@ static void cmp_node_premulkey_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_premulkey(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "mapping", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_premulkey()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_PREMULKEY, "Alpha Convert", NODE_CLASS_CONVERTER, 0);
ntype.declare = blender::nodes::cmp_node_premulkey_declare;
ntype.draw_buttons = node_composit_buts_premulkey;
nodeRegisterType(&ntype);
}

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Rotate ******************** */
@ -45,12 +48,18 @@ static void node_composit_init_rotate(bNodeTree *UNUSED(ntree), bNode *node)
node->custom1 = 1; /* Bilinear Filter. */
}
static void node_composit_buts_rotate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "filter_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_rotate()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_rotate_declare;
ntype.draw_buttons = node_composit_buts_rotate;
node_type_init(&ntype, node_composit_init_rotate);
nodeRegisterType(&ntype);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Scale ******************** */
@ -50,12 +55,31 @@ static void node_composite_update_scale(bNodeTree *ntree, bNode *node)
}
}
static void node_composit_buts_scale(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "space", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
if (RNA_enum_get(ptr, "space") == CMP_SCALE_RENDERPERCENT) {
uiLayout *row;
uiItemR(layout,
ptr,
"frame_method",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND,
nullptr,
ICON_NONE);
row = uiLayoutRow(layout, true);
uiItemR(row, ptr, "offset_x", UI_ITEM_R_SPLIT_EMPTY_NAME, "X", ICON_NONE);
uiItemR(row, ptr, "offset_y", UI_ITEM_R_SPLIT_EMPTY_NAME, "Y", ICON_NONE);
}
}
void register_node_type_cmp_scale()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_scale_declare;
ntype.draw_buttons = node_composit_buts_scale;
node_type_update(&ntype, node_composite_update_scale);
nodeRegisterType(&ntype);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** SET ALPHA ******************** */
@ -43,12 +46,18 @@ static void node_composit_init_setalpha(bNodeTree *UNUSED(ntree), bNode *node)
settings->mode = CMP_NODE_SETALPHA_MODE_APPLY;
}
static void node_composit_buts_set_alpha(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "mode", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_setalpha()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_SETALPHA, "Set Alpha", NODE_CLASS_CONVERTER, 0);
ntype.declare = blender::nodes::cmp_node_setalpha_declare;
ntype.draw_buttons = node_composit_buts_set_alpha;
node_type_init(&ntype, node_composit_init_setalpha);
node_type_storage(
&ntype, "NodeSetAlpha", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,11 +21,14 @@
* \ingroup cmpnodes
*/
#include "node_composite_util.hh"
#include "BKE_global.h"
#include "BKE_image.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** SPLIT VIEWER ******************** */
namespace blender::nodes {
@ -48,6 +51,16 @@ static void node_composit_init_splitviewer(bNodeTree *UNUSED(ntree), bNode *node
node->id = (ID *)BKE_image_ensure_viewer(G.main, IMA_TYPE_COMPOSITE, "Viewer Node");
}
static void node_composit_buts_splitviewer(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *row, *col;
col = uiLayoutColumn(layout, false);
row = uiLayoutRow(col, false);
uiItemR(row, ptr, "axis", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
uiItemR(col, ptr, "factor", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_splitviewer()
{
static bNodeType ntype;
@ -55,6 +68,7 @@ void register_node_type_cmp_splitviewer()
cmp_node_type_base(
&ntype, CMP_NODE_SPLITVIEWER, "Split Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_split_viewer_declare;
ntype.draw_buttons = node_composit_buts_splitviewer;
node_type_init(&ntype, node_composit_init_splitviewer);
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,11 +21,14 @@
* \ingroup cmpnodes
*/
#include "node_composite_util.hh"
#include "UI_interface.h"
#include "UI_resources.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "node_composite_util.hh"
/* **************** Stabilize 2D ******************** */
namespace blender::nodes {
@ -50,12 +53,36 @@ static void init(const bContext *C, PointerRNA *ptr)
node->custom1 = 1;
}
static void node_composit_buts_stabilize2d(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
uiTemplateID(layout,
C,
ptr,
"clip",
nullptr,
"CLIP_OT_open",
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
if (!node->id) {
return;
}
uiItemR(layout, ptr, "filter_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
uiItemR(layout, ptr, "invert", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_stabilize2d()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_stabilize2d_declare;
ntype.draw_buttons = node_composit_buts_stabilize2d;
ntype.initfunc_api = init;
nodeRegisterType(&ntype);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
@ -42,12 +45,24 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = data;
}
static void node_composit_buts_sunbeams(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "source", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, "", ICON_NONE);
uiItemR(layout,
ptr,
"ray_length",
UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER,
nullptr,
ICON_NONE);
}
void register_node_type_cmp_sunbeams()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_SUNBEAMS, "Sun Beams", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_sunbeams_declare;
ntype.draw_buttons = node_composit_buts_sunbeams;
node_type_init(&ntype, init);
node_type_storage(
&ntype, "NodeSunBeams", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "../node_composite_util.hh"
/* **************** Switch ******************** */
@ -36,6 +39,11 @@ static void cmp_node_switch_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_switch(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "check", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
/* custom1 = mix type */
void register_node_type_cmp_switch()
{
@ -43,6 +51,7 @@ void register_node_type_cmp_switch()
cmp_node_type_base(&ntype, CMP_NODE_SWITCH, "Switch", NODE_CLASS_LAYOUT, 0);
ntype.declare = blender::nodes::cmp_node_switch_declare;
ntype.draw_buttons = node_composit_buts_switch;
node_type_size_preset(&ntype, NODE_SIZE_SMALL);
nodeRegisterType(&ntype);
}

View File

@ -25,9 +25,13 @@
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "../node_composite_util.hh"
/* **************** SWITCH VIEW ******************** */
static bNodeSocketTemplate cmp_node_switch_view_out[] = {
{SOCK_RGBA, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
{-1, ""},
@ -137,13 +141,27 @@ static void init_switch_view(const bContext *C, PointerRNA *ptr)
cmp_node_switch_view_sanitycheck(ntree, node);
}
static void node_composit_buts_switch_view_ex(uiLayout *layout,
bContext *UNUSED(C),
PointerRNA *UNUSED(ptr))
{
uiItemFullO(layout,
"NODE_OT_switch_view_update",
"Update Views",
ICON_FILE_REFRESH,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
nullptr);
}
void register_node_type_cmp_switch_view()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_SWITCH_VIEW, "Switch View", NODE_CLASS_CONVERTER, 0);
node_type_socket_templates(&ntype, nullptr, cmp_node_switch_view_out);
ntype.draw_buttons_ex = node_composit_buts_switch_view_ex;
ntype.initfunc_api = init_switch_view;
node_type_update(&ntype, cmp_node_switch_view_update);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
@ -49,12 +54,35 @@ static void node_composit_init_tonemap(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = ntm;
}
static void node_composit_buts_tonemap(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "tonemap_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
if (RNA_enum_get(ptr, "tonemap_type") == 0) {
uiItemR(col, ptr, "key", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(col, ptr, "offset", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "gamma", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
else {
uiItemR(col, ptr, "intensity", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(
col, ptr, "contrast", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(
col, ptr, "adaptation", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
uiItemR(
col, ptr, "correction", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
}
void register_node_type_cmp_tonemap()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_TONEMAP, "Tonemap", NODE_CLASS_OP_COLOR, 0);
ntype.declare = blender::nodes::cmp_node_tonemap_declare;
ntype.draw_buttons = node_composit_buts_tonemap;
node_type_init(&ntype, node_composit_init_tonemap);
node_type_storage(&ntype, "NodeTonemap", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,11 @@
* \ingroup cmpnodes
*/
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
namespace blender::nodes {
@ -42,12 +47,61 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = data;
}
static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
uiTemplateID(layout,
C,
ptr,
"clip",
nullptr,
"CLIP_OT_open",
nullptr,
UI_TEMPLATE_ID_FILTER_ALL,
false,
nullptr);
if (node->id) {
MovieClip *clip = (MovieClip *)node->id;
MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *object;
uiLayout *col;
PointerRNA tracking_ptr;
NodeTrackPosData *data = (NodeTrackPosData *)node->storage;
RNA_pointer_create(&clip->id, &RNA_MovieTracking, tracking, &tracking_ptr);
col = uiLayoutColumn(layout, false);
uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
object = BKE_tracking_object_get_named(tracking, data->tracking_object);
if (object) {
PointerRNA object_ptr;
RNA_pointer_create(&clip->id, &RNA_MovieTrackingObject, object, &object_ptr);
uiItemPointerR(col, ptr, "track_name", &object_ptr, "tracks", "", ICON_ANIM_DATA);
}
else {
uiItemR(layout, ptr, "track_name", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_ANIM_DATA);
}
uiItemR(layout, ptr, "position", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (ELEM(node->custom1, CMP_TRACKPOS_RELATIVE_FRAME, CMP_TRACKPOS_ABSOLUTE_FRAME)) {
uiItemR(layout, ptr, "frame_relative", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
}
}
void register_node_type_cmp_trackpos()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_TRACKPOS, "Track Position", NODE_CLASS_INPUT, 0);
ntype.declare = blender::nodes::cmp_node_trackpos_declare;
ntype.draw_buttons = node_composit_buts_trackpos;
node_type_init(&ntype, init);
node_type_storage(
&ntype, "NodeTrackPosData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Transform ******************** */
@ -43,12 +46,18 @@ static void cmp_node_transform_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_transform(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "filter_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
void register_node_type_cmp_transform()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_TRANSFORM, "Transform", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_transform_declare;
ntype.draw_buttons = node_composit_buts_transform;
nodeRegisterType(&ntype);
}

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Translate ******************** */
@ -44,12 +47,19 @@ static void node_composit_init_translate(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = data;
}
static void node_composit_buts_translate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "use_relative", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "wrap_axis", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_translate()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, 0);
ntype.declare = blender::nodes::cmp_node_translate_declare;
ntype.draw_buttons = node_composit_buts_translate;
node_type_init(&ntype, node_composit_init_translate);
node_type_storage(
&ntype, "NodeTranslateData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** VECTOR BLUR ******************** */
@ -49,6 +52,22 @@ static void node_composit_init_vecblur(bNodeTree *UNUSED(ntree), bNode *node)
nbd->fac = 1.0f;
}
static void node_composit_buts_vecblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "samples", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "factor", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Blur"), ICON_NONE);
col = uiLayoutColumn(layout, true);
uiItemL(col, IFACE_("Speed:"), ICON_NONE);
uiItemR(col, ptr, "speed_min", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Min"), ICON_NONE);
uiItemR(col, ptr, "speed_max", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Max"), ICON_NONE);
uiItemR(layout, ptr, "use_curved", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
/* custom1: iterations, custom2: max_speed (0 = no_limit). */
void register_node_type_cmp_vecblur()
{
@ -56,6 +75,7 @@ void register_node_type_cmp_vecblur()
cmp_node_type_base(&ntype, CMP_NODE_VECBLUR, "Vector Blur", NODE_CLASS_OP_FILTER, 0);
ntype.declare = blender::nodes::cmp_node_vec_blur_declare;
ntype.draw_buttons = node_composit_buts_vecblur;
node_type_init(&ntype, node_composit_init_vecblur);
node_type_storage(
&ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,11 +21,16 @@
* \ingroup cmpnodes
*/
#include "node_composite_util.hh"
#include "BKE_global.h"
#include "BKE_image.h"
#include "RNA_access.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** VIEWER ******************** */
namespace blender::nodes {
@ -50,12 +55,32 @@ static void node_composit_init_viewer(bNodeTree *UNUSED(ntree), bNode *node)
node->id = (ID *)BKE_image_ensure_viewer(G.main, IMA_TYPE_COMPOSITE, "Viewer Node");
}
static void node_composit_buts_viewer(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "use_alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
static void node_composit_buts_viewer_ex(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
uiItemR(layout, ptr, "use_alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "tile_order", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (RNA_enum_get(ptr, "tile_order") == 0) {
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "center_x", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "center_y", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
}
void register_node_type_cmp_viewer()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW);
ntype.declare = blender::nodes::cmp_node_viewer_declare;
ntype.draw_buttons = node_composit_buts_viewer;
ntype.draw_buttons_ex = node_composit_buts_viewer_ex;
node_type_init(&ntype, node_composit_init_viewer);
node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage);

View File

@ -21,6 +21,9 @@
* \ingroup cmpnodes
*/
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_composite_util.hh"
/* **************** Z COMBINE ******************** */
@ -39,12 +42,22 @@ static void cmp_node_zcombine_declare(NodeDeclarationBuilder &b)
} // namespace blender::nodes
static void node_composit_buts_zcombine(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *col;
col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "use_alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(col, ptr, "use_antialias_z", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
void register_node_type_cmp_zcombine()
{
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_ZCOMBINE, "Z Combine", NODE_CLASS_OP_COLOR, 0);
ntype.declare = blender::nodes::cmp_node_zcombine_declare;
ntype.draw_buttons = node_composit_buts_zcombine;
nodeRegisterType(&ntype);
}