Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_stabilize2d.cc
| Show All 22 Lines | |||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| /* **************** Stabilize 2D ******************** */ | /* **************** Stabilize 2D ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes::node_cmp_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); | ||||
| /* default to bilinear, see node_sampler_type_items in rna_nodetree.c */ | /* default to bilinear, see node_sampler_type_items in rna_nodetree.c */ | ||||
| node->custom1 = 1; | node->custom1 = 1; | ||||
| } | } | ||||
| } // namespace blender::nodes::node_cmp_stabilize2d_cc | |||||
| void register_node_type_cmp_stabilize2d() | void register_node_type_cmp_stabilize2d() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_cmp_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, 0); | ||||
| ntype.declare = blender::nodes::cmp_node_stabilize2d_declare; | ntype.declare = file_ns::cmp_node_stabilize2d_declare; | ||||
| ntype.initfunc_api = init; | ntype.initfunc_api = file_ns::init; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||