31 switch (node_storage(
node).mode) {
41 switch (node_storage(
node).mode) {
47 return IFACE_(
"Saturation");
51 switch (node_storage(
node).mode) {
56 return IFACE_(
"Lightness");
67 return "separate_color_rgb";
69 return "separate_color_hsv";
71 return "separate_color_hsl";
85 if (name !=
nullptr) {
96 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
106 convert = create_node(
"rgbtohsv", NodeItem::Type::Color3, {{
"in",
color}});
112 int index =
STREQ(socket_out_->identifier,
"Red") ? 0 :
113 STREQ(socket_out_->identifier,
"Green") ? 1 :
129 ntype.
ui_name =
"Separate Color";
130 ntype.
ui_description =
"Split a color into its individual components using multiple models";
133 ntype.
declare = file_ns::sh_node_sepcolor_declare;
137 ntype.
gpu_fn = file_ns::gpu_shader_sepcolor;
157 switch (node_storage(
node).mode) {
172 switch (node_storage(
node).mode) {
178 return IFACE_(
"Saturation");
187 switch (node_storage(
node).mode) {
192 return IFACE_(
"Lightness");
204 return "combine_color_rgb";
206 return "combine_color_hsv";
208 return "combine_color_hsl";
222 if (name !=
nullptr) {
233 NodeItem red = get_input_value(
"Red", NodeItem::Type::Float);
234 NodeItem green = get_input_value(
"Green", NodeItem::Type::Float);
235 NodeItem blue = get_input_value(
"Blue", NodeItem::Type::Float);
237 NodeItem combine = create_node(
"combine3", NodeItem::Type::Color3);
238 combine.set_input(
"in1", red);
239 combine.set_input(
"in2", green);
240 combine.set_input(
"in3", blue);
242 NodeItem res = empty();
250 res = create_node(
"hsvtorgb", NodeItem::Type::Color3);
251 res.set_input(
"in", combine);
270 ntype.
ui_name =
"Combine Color";
271 ntype.
ui_description =
"Create a color from individual components using multiple models";
274 ntype.
declare = file_ns::sh_node_combcolor_declare;
278 ntype.
gpu_fn = file_ns::gpu_shader_combcolor;
#define NODE_CLASS_CONVERTER
#define NODE_STORAGE_FUNCS(StorageT)
#define SH_NODE_COMBINE_COLOR
#define SH_NODE_SEPARATE_COLOR
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_COLOR
#define BLI_assert_unreachable()
std::unique_ptr< CustomSocketLabelFn > label_fn
ColorGeometry4f default_value
#define storage(slot, qualifiers)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
static void sh_node_combcolor_declare(NodeDeclarationBuilder &b)
static int gpu_shader_combcolor(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static const char * gpu_shader_get_name(int mode)
static const char * gpu_shader_get_name(int mode)
static int gpu_shader_sepcolor(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_sepcolor_declare(NodeDeclarationBuilder &b)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
static void node_combsep_color_init(bNodeTree *, bNode *node)
void register_node_type_sh_sepcolor()
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
BMesh const char void * data
void register_node_type_sh_combcolor()
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
void convert(DstType &, const SrcType)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
NodeMaterialXFunction materialx_fn
std::string ui_description
NodeGPUExecFunction gpu_fn
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare