Differential D13466 Diff 46668 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 25 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" | ||||
| /* **************** Translate ******************** */ | /* **************** Translate ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_moviedistortion_cc { | ||||
| static void cmp_node_moviedistortion_declare(NodeDeclarationBuilder &b) | 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}); | 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 label(const bNodeTree *UNUSED(ntree), const bNode *node, char *label, int maxlen) | static void label(const bNodeTree *UNUSED(ntree), const 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 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | static void node_composit_buts_moviedistortion(uiLayout *layout, bContext *C, PointerRNA *ptr) | ||||
| if (!node->id) { | if (!node->id) { | ||||
| return; | return; | ||||
| } | } | ||||
| uiItemR(layout, ptr, "distortion_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); | uiItemR(layout, ptr, "distortion_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_moviedistortion_cc | |||||
| void register_node_type_cmp_moviedistortion() | void register_node_type_cmp_moviedistortion() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_moviedistortion_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_MOVIEDISTORTION, "Movie Distortion", NODE_CLASS_DISTORT); | cmp_node_type_base(&ntype, CMP_NODE_MOVIEDISTORTION, "Movie Distortion", NODE_CLASS_DISTORT); | ||||
| ntype.declare = blender::nodes::cmp_node_moviedistortion_declare; | ntype.declare = file_ns::cmp_node_moviedistortion_declare; | ||||
| ntype.draw_buttons = node_composit_buts_moviedistortion; | ntype.draw_buttons = file_ns::node_composit_buts_moviedistortion; | ||||
| ntype.labelfunc = label; | ntype.labelfunc = file_ns::label; | ||||
| ntype.initfunc_api = init; | ntype.initfunc_api = file_ns::init; | ||||
| node_type_storage(&ntype, nullptr, storage_free, storage_copy); | node_type_storage(&ntype, nullptr, file_ns::storage_free, file_ns::storage_copy); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||