43 return "separate_color_rgb";
45 return "separate_color_hsv";
47 return "separate_color_hsl";
61 if (
name !=
nullptr) {
72 NodeItem
color = get_input_value(
"Color", NodeItem::Type::Color3);
74 NodeItem convert = empty();
82 convert = create_node(
"rgbtohsv", NodeItem::Type::Color3, {{
"in",
color}});
88 int index =
STREQ(socket_out_->identifier,
"Red") ? 0 :
89 STREQ(socket_out_->identifier,
"Green") ? 1 :
105 ntype.
ui_name =
"Separate Color";
106 ntype.
ui_description =
"Split a color into its individual components using multiple models";
109 ntype.
declare = file_ns::sh_node_sepcolor_declare;
110 ntype.
updatefunc = file_ns::node_sepcolor_update;
114 ntype.
gpu_fn = file_ns::gpu_shader_sepcolor;
144 return "combine_color_rgb";
146 return "combine_color_hsv";
148 return "combine_color_hsl";
162 if (
name !=
nullptr) {
173 NodeItem red = get_input_value(
"Red", NodeItem::Type::Float);
174 NodeItem green = get_input_value(
"Green", NodeItem::Type::Float);
175 NodeItem blue = get_input_value(
"Blue", NodeItem::Type::Float);
177 NodeItem combine = create_node(
"combine3", NodeItem::Type::Color3);
178 combine.set_input(
"in1", red);
179 combine.set_input(
"in2", green);
180 combine.set_input(
"in3", blue);
182 NodeItem res = empty();
190 res = create_node(
"hsvtorgb", NodeItem::Type::Color3);
191 res.set_input(
"in", combine);
210 ntype.
ui_name =
"Combine Color";
211 ntype.
ui_description =
"Create a color from individual components using multiple models";
214 ntype.
declare = file_ns::sh_node_combcolor_declare;
215 ntype.
updatefunc = file_ns::node_combcolor_update;
219 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 BLI_assert_unreachable()
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
BMesh const char void * data
ColorGeometry4f default_value
void * MEM_callocN(size_t len, const char *str)
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))
void convert(SignedNormalized< StorageType > &dst, const F32 &src)
static void node_combcolor_update(bNodeTree *, bNode *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 void node_sepcolor_update(bNodeTree *, bNode *node)
static int gpu_shader_sepcolor(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_sepcolor_declare(NodeDeclarationBuilder &b)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_sepcolor()
static void node_combsep_color_init(bNodeTree *, bNode *node)
void register_node_type_sh_combcolor()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode)
NodeMaterialXFunction materialx_fn
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)