Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_trackpos.cc
| Show All 22 Lines | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #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" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_trackpos_cc { | ||||
| static void cmp_node_trackpos_declare(NodeDeclarationBuilder &b) | static void cmp_node_trackpos_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_output<decl::Float>(N_("X")); | b.add_output<decl::Float>(N_("X")); | ||||
| b.add_output<decl::Float>(N_("Y")); | b.add_output<decl::Float>(N_("Y")); | ||||
| b.add_output<decl::Vector>(N_("Speed")).subtype(PROP_VELOCITY); | b.add_output<decl::Vector>(N_("Speed")).subtype(PROP_VELOCITY); | ||||
| } | } | ||||
| } // namespace blender::nodes | |||||
| static void init(bNodeTree *UNUSED(ntree), bNode *node) | static void init(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeTrackPosData *data = MEM_cnew<NodeTrackPosData>(__func__); | NodeTrackPosData *data = MEM_cnew<NodeTrackPosData>(__func__); | ||||
| node->storage = data; | node->storage = data; | ||||
| } | } | ||||
| static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRNA *ptr) | static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRNA *ptr) | ||||
| Show All 39 Lines | if (node->id) { | ||||
| uiItemR(layout, ptr, "position", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(layout, ptr, "position", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| if (ELEM(node->custom1, CMP_TRACKPOS_RELATIVE_FRAME, CMP_TRACKPOS_ABSOLUTE_FRAME)) { | if (ELEM(node->custom1, CMP_TRACKPOS_RELATIVE_FRAME, CMP_TRACKPOS_ABSOLUTE_FRAME)) { | ||||
| uiItemR(layout, ptr, "frame_relative", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(layout, ptr, "frame_relative", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_trackpos_cc | |||||
| void register_node_type_cmp_trackpos() | void register_node_type_cmp_trackpos() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_trackpos_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_TRACKPOS, "Track Position", NODE_CLASS_INPUT, 0); | cmp_node_type_base(&ntype, CMP_NODE_TRACKPOS, "Track Position", NODE_CLASS_INPUT); | ||||
| ntype.declare = blender::nodes::cmp_node_trackpos_declare; | ntype.declare = file_ns::cmp_node_trackpos_declare; | ||||
| ntype.draw_buttons = node_composit_buts_trackpos; | ntype.draw_buttons = file_ns::node_composit_buts_trackpos; | ||||
| node_type_init(&ntype, init); | node_type_init(&ntype, file_ns::init); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeTrackPosData", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeTrackPosData", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||