Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_stabilize2d.cc
| Show All 25 Lines | |||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* **************** Stabilize 2D ******************** */ | /* **************** Stabilize 2D ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_stabilize2d_cc { | ||||
| static void cmp_node_stabilize2d_declare(NodeDeclarationBuilder &b) | static void cmp_node_stabilize2d_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_output<decl::Color>(N_("Image")); | b.add_output<decl::Color>(N_("Image")); | ||||
| } | } | ||||
| } // namespace blender::nodes | |||||
| static void init(const bContext *C, PointerRNA *ptr) | static void init(const bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| bNode *node = (bNode *)ptr->data; | bNode *node = (bNode *)ptr->data; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| node->id = (ID *)scene->clip; | node->id = (ID *)scene->clip; | ||||
| id_us_plus(node->id); | id_us_plus(node->id); | ||||
| Show All 19 Lines | static void node_composit_buts_stabilize2d(uiLayout *layout, bContext *C, PointerRNA *ptr) | ||||
| if (!node->id) { | if (!node->id) { | ||||
| return; | return; | ||||
| } | } | ||||
| uiItemR(layout, ptr, "filter_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); | 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); | uiItemR(layout, ptr, "invert", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_stabilize2d_cc | |||||
| void register_node_type_cmp_stabilize2d() | void register_node_type_cmp_stabilize2d() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_stabilize2d_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, 0); | cmp_node_type_base(&ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT); | ||||
| ntype.declare = blender::nodes::cmp_node_stabilize2d_declare; | ntype.declare = file_ns::cmp_node_stabilize2d_declare; | ||||
| ntype.draw_buttons = node_composit_buts_stabilize2d; | ntype.draw_buttons = file_ns::node_composit_buts_stabilize2d; | ||||
| ntype.initfunc_api = init; | ntype.initfunc_api = file_ns::init; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||