Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_keying.cc
| Show All 28 Lines | |||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* **************** Keying ******************** */ | /* **************** Keying ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_keying_cc { | ||||
| static void cmp_node_keying_declare(NodeDeclarationBuilder &b) | static void cmp_node_keying_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Color>(N_("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_input<decl::Color>(N_("Key Color")).default_value({1.0f, 1.0f, 1.0f, 1.0f}); | b.add_input<decl::Color>(N_("Key Color")).default_value({1.0f, 1.0f, 1.0f, 1.0f}); | ||||
| b.add_input<decl::Float>(N_("Garbage Matte")).hide_value(); | b.add_input<decl::Float>(N_("Garbage Matte")).hide_value(); | ||||
| b.add_input<decl::Float>(N_("Core Matte")).hide_value(); | b.add_input<decl::Float>(N_("Core Matte")).hide_value(); | ||||
| b.add_output<decl::Color>(N_("Image")); | b.add_output<decl::Color>(N_("Image")); | ||||
| b.add_output<decl::Float>(N_("Matte")); | b.add_output<decl::Float>(N_("Matte")); | ||||
| b.add_output<decl::Float>(N_("Edges")); | b.add_output<decl::Float>(N_("Edges")); | ||||
| } | } | ||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_keying(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_keying(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeKeyingData *data = MEM_cnew<NodeKeyingData>(__func__); | NodeKeyingData *data = MEM_cnew<NodeKeyingData>(__func__); | ||||
| data->screen_balance = 0.5f; | data->screen_balance = 0.5f; | ||||
| data->despill_balance = 0.5f; | data->despill_balance = 0.5f; | ||||
| data->despill_factor = 1.0f; | data->despill_factor = 1.0f; | ||||
| data->edge_kernel_radius = 3; | data->edge_kernel_radius = 3; | ||||
| Show All 16 Lines | static void node_composit_buts_keying(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | ||||
| uiItemR(layout, ptr, "clip_black", 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, "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, "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_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, "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); | uiItemR(layout, ptr, "blur_post", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_keying_cc | |||||
| void register_node_type_cmp_keying() | void register_node_type_cmp_keying() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_keying_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_KEYING, "Keying", NODE_CLASS_MATTE, 0); | cmp_node_type_base(&ntype, CMP_NODE_KEYING, "Keying", NODE_CLASS_MATTE, 0); | ||||
| ntype.declare = blender::nodes::cmp_node_keying_declare; | ntype.declare = file_ns::cmp_node_keying_declare; | ||||
| ntype.draw_buttons = node_composit_buts_keying; | ntype.draw_buttons = file_ns::node_composit_buts_keying; | ||||
| node_type_init(&ntype, node_composit_init_keying); | node_type_init(&ntype, file_ns::node_composit_init_keying); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeKeyingData", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeKeyingData", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||