Differential D13523 Diff 46102 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 15 Lines | |||||
| * The Original Code is Copyright (C) 2011 Blender Foundation. | * The Original Code is Copyright (C) 2011 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.hh" | |||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "UI_interface.h" | |||||
| #include "UI_resources.h" | |||||
| #include "node_composite_util.hh" | |||||
| /* **************** Translate ******************** */ | /* **************** Translate ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| 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")); | ||||
| Show All 31 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); | ||||
| } | } | ||||
| } | } | ||||
| static void node_composit_buts_moviedistortion(uiLayout *layout, bContext *C, PointerRNA *ptr) | |||||
| { | |||||
| bNode *node = (bNode *)ptr->data; | |||||
| uiTemplateID(layout, | |||||
| C, | |||||
| ptr, | |||||
| "clip", | |||||
| nullptr, | |||||
| "CLIP_OT_open", | |||||
| nullptr, | |||||
| UI_TEMPLATE_ID_FILTER_ALL, | |||||
| false, | |||||
| nullptr); | |||||
| if (!node->id) { | |||||
| return; | |||||
| } | |||||
| uiItemR(layout, ptr, "distortion_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); | |||||
| } | |||||
| void register_node_type_cmp_moviedistortion() | 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); | ||||
| ntype.declare = blender::nodes::cmp_node_moviedistortion_declare; | ntype.declare = blender::nodes::cmp_node_moviedistortion_declare; | ||||
| ntype.draw_buttons = node_composit_buts_moviedistortion; | |||||
| ntype.labelfunc = label; | ntype.labelfunc = 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); | ||||
| } | } | ||||