Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_valToRgb.cc
| Show All 23 Lines | |||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* **************** VALTORGB ******************** */ | /* **************** VALTORGB ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void cmp_node_valtorgb_declare(NodeDeclarationBuilder &b) | static void cmp_node_valtorgb_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Float>("Fac").default_value(0.5f).min(0.0f).max(1.0f).subtype(PROP_FACTOR); | b.add_input<decl::Float>(N_("Fac")).default_value(0.5f).min(0.0f).max(1.0f).subtype(PROP_FACTOR); | ||||
| b.add_output<decl::Color>("Image"); | b.add_output<decl::Color>(N_("Image")); | ||||
| b.add_output<decl::Float>("Alpha"); | b.add_output<decl::Float>(N_("Alpha")); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes | ||||
| static void node_composit_init_valtorgb(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_valtorgb(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->storage = BKE_colorband_add(true); | node->storage = BKE_colorband_add(true); | ||||
| } | } | ||||
| Show All 12 Lines | |||||
| } | } | ||||
| /* **************** RGBTOBW ******************** */ | /* **************** RGBTOBW ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void cmp_node_rgbtobw_declare(NodeDeclarationBuilder &b) | static void cmp_node_rgbtobw_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Color>("Image").default_value({0.8f, 0.8f, 0.8f, 1.0f}); | b.add_input<decl::Color>(N_("Image")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | ||||
| b.add_output<decl::Color>("Val"); | b.add_output<decl::Color>(N_("Val")); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes | ||||
| void register_node_type_cmp_rgbtobw(void) | void register_node_type_cmp_rgbtobw(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTER, 0); | cmp_node_type_base(&ntype, CMP_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTER, 0); | ||||
| ntype.declare = blender::nodes::cmp_node_rgbtobw_declare; | ntype.declare = blender::nodes::cmp_node_rgbtobw_declare; | ||||
| node_type_size_preset(&ntype, NODE_SIZE_SMALL); | node_type_size_preset(&ntype, NODE_SIZE_SMALL); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||