18#include "RNA_prototypes.hh"
37 N_(
"Returns the position and speed of the marker at the current scene frame relative to the "
38 "zero origin of the tracking space")},
43 N_(
"Returns the position and speed of the marker at the current scene frame relative to the "
44 "position of the first non-disabled marker in the track")},
49 N_(
"Returns the position and speed of the marker at the current scene frame relative to the "
50 "position of the marker at the current scene frame plus the user given relative frame")},
55 N_(
"Returns the position and speed of the marker at the given absolute frame")},
56 {0,
nullptr, 0,
nullptr,
nullptr},
90 node->id = &movie_clip->
id;
107 template_id(&layout,
C, ptr,
"clip",
nullptr,
"CLIP_OT_open",
nullptr);
117 col.
prop_search(ptr,
"tracking_object", &tracking_ptr,
"objects",
"", ICON_OBJECT_DATA);
120 if (tracking_object) {
122 &clip->
id, RNA_MovieTrackingObject, tracking_object);
124 col.
prop_search(ptr,
"track_name", &object_ptr,
"tracks",
"", ICON_ANIM_DATA);
181 if (!
result.should_compute()) {
189 track, current_marker_position, -1);
190 const float2 speed_toward_previous = previous_marker_position - current_marker_position;
195 track, current_marker_position, 1);
196 const float2 speed_toward_next = current_marker_position - next_marker_position;
200 speed_toward_next *
float2(size));
202 result.allocate_single_value();
203 result.set_single_value(speed);
230 float2 current_marker_position,
238 return current_marker_position;
301 movie_tracking, node_storage(
node()).tracking_object);
302 if (!movie_tracking_object) {
307 node_storage(
node()).track_name);
351 this->
get_input(
"Mode").get_single_value_default<MenuValue>().value);
356 return id_cast<MovieClip *>(
node().
id);
370 ntype.
ui_name =
"Track Position";
372 "Provide information about motion tracking points, such as x and y values";
#define NODE_STORAGE_FUNCS(StorageT)
#define CMP_NODE_TRACKPOS
#define STRNCPY_UTF8(dst, src)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr IndexRange()=default
int get_frame_number() const
NodeOperation(Context &context, const bNode &node)
const bNode & node() const
Result & get_result(StringRef identifier)
Context & context() const
Result & get_input(StringRef identifier) const
bool should_compute() const
void set_single_value(const T &value)
T get_single_value_default() const
void allocate_single_value()
NodeOperation(Context &context, const bNode &node)
float2 compute_first_marker_position(MovieTrackingTrack *track)
float2 compute_temporally_neighboring_marker_position(MovieTrackingTrack *track, float2 current_marker_position, int time_delta)
float2 compute_reference_marker_position(MovieTrackingTrack *track)
void execute_position(MovieTrackingTrack *track, float2 current_marker_position, int2 size)
MovieClip * get_movie_clip()
MovieTrackingTrack * get_movie_tracking_track()
float2 compute_marker_position_at_frame(MovieTrackingTrack *track, int frame)
CMPNodeTrackPositionMode get_mode()
void execute_speed(MovieTrackingTrack *track, float2 current_marker_position, int2 size)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
static void node_init_api(const bContext *C, PointerRNA *node_ptr)
static void node_draw_buttons(ui::Layout &layout, bContext *C, PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static const EnumPropertyItem mode_items[]
static void node_init(bNodeTree *, bNode *node)
@ ITEM_R_SPLIT_EMPTY_NAME
MovieTrackingMarker * BKE_tracking_marker_get_exact(MovieTrackingTrack *track, int framenr)
void BKE_movieclip_get_size(MovieClip *clip, const MovieClipUser *user, int *r_width, int *r_height)
MovieTrackingObject * BKE_tracking_object_get_active(const MovieTracking *tracking)
BMesh const char void * data
MovieTrackingTrack * BKE_tracking_object_find_track_with_name(MovieTrackingObject *tracking_object, const char *name)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
@ CMP_NODE_TRACK_POSITION_RELATIVE_FRAME
@ CMP_NODE_TRACK_POSITION_RELATIVE_START
@ CMP_NODE_TRACK_POSITION_ABSOLUTE
@ CMP_NODE_TRACK_POSITION_ABSOLUTE_FRAME
void BKE_movieclip_user_set_frame(MovieClipUser *user, int framenr)
float BKE_movieclip_remap_scene_to_clip_frame(const MovieClip *clip, float framenr)
MovieTrackingObject * BKE_tracking_object_get_named(MovieTracking *tracking, const char *name)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
Scene * CTX_data_scene(const bContext *C)
void node_free_standard_storage(bNode *node)
MovieTrackingMarker * BKE_tracking_marker_get(MovieTrackingTrack *track, int framenr)
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
struct MovieTracking tracking
MovieTrackingTrack * active_track
MovieTrackingMarker * markers
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
void(*) initfunc_api(const bContext *C, PointerRNA *ptr)
NodeGetCompositorOperationFunction get_compositor_operation
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare
void prop_search(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop, PropertyRNA *item_searchpropname, std::optional< StringRefNull > name, int icon, bool results_are_suggestions)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
Layout & column(bool align)