Differential D13303 Diff 45857 source/blender/nodes/composite/nodes/node_composite_moviedistortion.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_moviedistortion.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" | ||||
| /* **************** Translate ******************** */ | /* **************** Translate ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_moviedistortion_in[] = { | namespace blender::nodes { | ||||
| {SOCK_RGBA, N_("Image"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, | |||||
| {-1, ""}, | static void cmp_node_moviedistortion_declare(NodeDeclarationBuilder &b) | ||||
| }; | { | ||||
| b.add_input<decl::Color>(N_("Image")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | |||||
| static bNodeSocketTemplate cmp_node_moviedistortion_out[] = { | b.add_output<decl::Color>(N_("Image")); | ||||
| {SOCK_RGBA, N_("Image")}, | } | ||||
| {-1, ""}, | |||||
| }; | } // namespace blender::nodes | ||||
| static void label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen) | static void label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen) | ||||
| { | { | ||||
| if (node->custom1 == 0) { | if (node->custom1 == 0) { | ||||
| BLI_strncpy(label, IFACE_("Undistortion"), maxlen); | BLI_strncpy(label, IFACE_("Undistortion"), maxlen); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_strncpy(label, IFACE_("Distortion"), maxlen); | BLI_strncpy(label, IFACE_("Distortion"), maxlen); | ||||
| Show All 20 Lines | |||||
| static void storage_copy(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node) | static void storage_copy(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node) | ||||
| { | { | ||||
| if (src_node->storage) { | if (src_node->storage) { | ||||
| dest_node->storage = BKE_tracking_distortion_copy((MovieDistortion *)src_node->storage); | dest_node->storage = BKE_tracking_distortion_copy((MovieDistortion *)src_node->storage); | ||||
| } | } | ||||
| } | } | ||||
| void register_node_type_cmp_moviedistortion(void) | void register_node_type_cmp_moviedistortion() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_MOVIEDISTORTION, "Movie Distortion", NODE_CLASS_DISTORT, 0); | cmp_node_type_base(&ntype, CMP_NODE_MOVIEDISTORTION, "Movie Distortion", NODE_CLASS_DISTORT, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_moviedistortion_in, cmp_node_moviedistortion_out); | ntype.declare = blender::nodes::cmp_node_moviedistortion_declare; | ||||
| node_type_label(&ntype, label); | node_type_label(&ntype, label); | ||||
| ntype.initfunc_api = init; | ntype.initfunc_api = init; | ||||
| node_type_storage(&ntype, nullptr, storage_free, storage_copy); | node_type_storage(&ntype, nullptr, storage_free, storage_copy); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||