Blender V5.0
clip_intern.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_space_types.h"
12#include "DNA_tracking_types.h"
13
14struct ARegion;
15struct ARegionType;
16struct MovieClip;
19struct Scene;
20struct SpaceClip;
21struct bContext;
22struct wmOperatorType;
23
24/* channel heights */
25#define CHANNEL_FIRST (-UI_TIME_SCRUB_MARGIN_Y - CHANNEL_HEIGHT_HALF - CHANNEL_SKIP)
26#define CHANNEL_HEIGHT (0.8f * U.widget_unit)
27#define CHANNEL_HEIGHT_HALF (0.4f * U.widget_unit)
28#define CHANNEL_SKIP (0.1f * U.widget_unit)
29#define CHANNEL_STEP (CHANNEL_HEIGHT + CHANNEL_SKIP)
30
31#define CHANNEL_PAD 4
32
33/* extra padding for lengths (to go under scrollers) */
34#define EXTRA_SCROLL_PAD 100.0f
35
36#define STRIP_HEIGHT_HALF (0.25f * UI_UNIT_Y)
37
38/* internal exports only */
39
40/* clip_buttons.cc */
41
43
44/* clip_dopesheet_draw.cc */
45
46void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene);
48
49/* clip_dopesheet_ops.cc */
50
53
54/* clip_draw.cc */
55
56void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region);
57
58/* draw grease pencil */
59
60void clip_draw_grease_pencil(bContext *C, int onlyv2d);
61void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region);
62
63/* clip_editor.cc */
64
66
67/* clip_graph_draw.cc */
68
69void clip_draw_graph(SpaceClip *sc, ARegion *region, Scene *scene);
70
71/* clip_graph_ops.cc */
72
74
83
84/* clip_ops.cc */
85
99
100#ifdef WITH_INPUT_NDOF
101void CLIP_OT_view_ndof(wmOperatorType *ot);
102#endif
103
105
107
109
111
112/* clip_utils.cc */
113
119
120using ClipTrackValueCallback = void (*)(void *userdata,
121 MovieTrackingTrack *track,
122 MovieTrackingMarker *marker,
123 eClipCurveValueSource value_source,
124 int scene_framenr,
125 float val);
126
127using ClipTrackValueSegmentStartCallback = void (*)(void *userdata,
128 MovieTrackingTrack *track,
129 eClipCurveValueSource value_source,
130 bool is_point);
131
132using ClipTrackValueSegmentEndCallback = void (*)(void *userdata,
133 eClipCurveValueSource value_source);
134
136
138 MovieTrackingTrack *track,
139 void *userdata,
143
145 bool selected_only,
146 bool include_hidden,
147 void *userdata,
151
153 bool selected_only,
154 bool include_hidden,
155 void *userdata,
156 void (*func)(void *userdata, MovieTrackingMarker *marker));
157
160 MovieClip *clip,
161 MovieTrackingTrack *track,
162 MovieTrackingMarker *marker);
163
165
170 SpaceClip *sc, float x, float y, float *r_offset_x, float *r_offset_y);
171void clip_view_center_to_point(SpaceClip *sc, float x, float y);
172
174 const bContext *C, bool fit, float *r_offset_x, float *r_offset_y, float *r_zoom);
175
181
182/* tracking_ops.cc */
183
184/* Find track which can be slid in a proximity of the given event.
185 * Uses the same distance tolerance rule as the "Slide Marker" operator. */
187
192
197
201
206
208
215
217
220
222
226
230
232
235
238
241
244
247
248/* tracking_select.cc */
249
256
257/* -------------------------------------------------------------------- */
260
261/* Check whether the marker can is visible within the given context.
262 * The track must be visible, and no restrictions from the clip editor are to be in effect on the
263 * disabled marker visibility (unless the track is active). */
265 const MovieTrackingObject *tracking_object,
266 const MovieTrackingTrack *track,
267 const MovieTrackingMarker *marker)
268{
269 if (track->flag & TRACK_HIDDEN) {
270 return false;
271 }
272
273 if ((marker->flag & MARKER_DISABLED) == 0) {
274 return true;
275 }
276
277 if ((space_clip->flag & SC_HIDE_DISABLED) == 0) {
278 return true;
279 }
280
281 return track == tracking_object->active_track;
282}
283
#define BLI_INLINE
@ SC_HIDE_DISABLED
@ TRACK_HIDDEN
@ MARKER_DISABLED
#define C
Definition RandGen.cpp:29
void CLIP_OT_paste_tracks(wmOperatorType *ot)
void CLIP_OT_create_plane_track(wmOperatorType *ot)
MovieTrackingTrack * tracking_find_slidable_track_in_proximity(bContext *C, const float co[2])
void CLIP_OT_delete_marker(wmOperatorType *ot)
void CLIP_OT_set_origin(wmOperatorType *ot)
void CLIP_OT_view_zoom_in(wmOperatorType *ot)
Definition clip_ops.cc:781
void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region)
void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack *track, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
void CLIP_OT_stabilize_2d_rotation_add(wmOperatorType *ot)
void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
Definition clip_ops.cc:890
void CLIP_OT_stabilize_2d_remove(wmOperatorType *ot)
bool clip_graph_value_visible(SpaceClip *sc, eClipCurveValueSource value_source)
Definition clip_utils.cc:40
void CLIP_OT_track_copy_color(wmOperatorType *ot)
void CLIP_OT_dopesheet_view_all(wmOperatorType *ot)
void CLIP_OT_hide_tracks_clear(wmOperatorType *ot)
void CLIP_OT_cursor_set(wmOperatorType *ot)
Definition clip_ops.cc:1815
void CLIP_OT_keyframe_delete(wmOperatorType *ot)
void CLIP_OT_graph_delete_knot(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_rotation_remove(wmOperatorType *ot)
void ED_clip_buttons_register(ARegionType *art)
void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
void CLIP_OT_select_circle(wmOperatorType *ot)
void CLIP_OT_mode_set(wmOperatorType *ot)
Definition clip_ops.cc:1610
void CLIP_OT_clear_solution(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_select(wmOperatorType *ot)
void CLIP_OT_view_zoom(wmOperatorType *ot)
Definition clip_ops.cc:715
void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene)
void CLIP_OT_hide_tracks(wmOperatorType *ot)
void CLIP_OT_track_markers(wmOperatorType *ot)
void CLIP_OT_view_zoom_out(wmOperatorType *ot)
Definition clip_ops.cc:838
void CLIP_OT_stabilize_2d_add(wmOperatorType *ot)
void CLIP_OT_apply_solution_scale(wmOperatorType *ot)
void clip_delete_marker(bContext *C, MovieClip *clip, MovieTrackingTrack *track, MovieTrackingMarker *marker)
void CLIP_OT_set_solver_keyframe(wmOperatorType *ot)
void CLIP_OT_open(wmOperatorType *ot)
Definition clip_ops.cc:303
void CLIP_OT_detect_features(wmOperatorType *ot)
void CLIP_OT_set_scene_frames(wmOperatorType *ot)
Definition clip_ops.cc:1763
void CLIP_OT_change_frame(wmOperatorType *ot)
Definition clip_ops.cc:1163
void CLIP_OT_lock_tracks(wmOperatorType *ot)
void clip_delete_plane_track(bContext *C, MovieClip *clip, MovieTrackingPlaneTrack *plane_track)
void CLIP_OT_average_tracks(wmOperatorType *ot)
void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot)
BLI_INLINE bool ED_space_clip_marker_is_visible(const SpaceClip *space_clip, const MovieTrackingObject *tracking_object, const MovieTrackingTrack *track, const MovieTrackingMarker *marker)
void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region)
void(*)(void *userdata, MovieTrackingTrack *track, eClipCurveValueSource value_source, bool is_point) ClipTrackValueSegmentStartCallback
void CLIP_OT_view_selected(wmOperatorType *ot)
Definition clip_ops.cc:1044
void CLIP_OT_set_solution_scale(wmOperatorType *ot)
void CLIP_OT_set_axis(wmOperatorType *ot)
void clip_view_center_to_point(SpaceClip *sc, float x, float y)
void CLIP_OT_tracking_object_new(wmOperatorType *ot)
void CLIP_OT_keyframe_insert(wmOperatorType *ot)
void CLIP_OT_select_lasso(wmOperatorType *ot)
void CLIP_OT_copy_tracks(wmOperatorType *ot)
void CLIP_OT_graph_center_current_frame(wmOperatorType *ot)
void CLIP_OT_select_all(wmOperatorType *ot)
void CLIP_OT_slide_marker(wmOperatorType *ot)
void CLIP_OT_solve_camera(wmOperatorType *ot)
void CLIP_OT_prefetch(wmOperatorType *ot)
Definition clip_ops.cc:1722
void CLIP_OT_set_scale(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_rotation_select(wmOperatorType *ot)
void CLIP_OT_view_center_cursor(wmOperatorType *ot)
Definition clip_ops.cc:1012
void CLIP_OT_select_box(wmOperatorType *ot)
void CLIP_OT_add_marker_at_click(wmOperatorType *ot)
void CLIP_OT_graph_delete_curve(wmOperatorType *ot)
void CLIP_OT_clean_tracks(wmOperatorType *ot)
void CLIP_OT_join_tracks(wmOperatorType *ot)
void CLIP_OT_rebuild_proxy(wmOperatorType *ot)
Definition clip_ops.cc:1572
void CLIP_OT_lock_selection_toggle(wmOperatorType *ot)
Definition clip_ops.cc:1865
void CLIP_OT_graph_select_all_markers(wmOperatorType *ot)
bool clip_view_calculate_view_selection(const bContext *C, bool fit, float *r_offset_x, float *r_offset_y, float *r_zoom)
void CLIP_OT_slide_plane_marker(wmOperatorType *ot)
void CLIP_OT_refine_markers(wmOperatorType *ot)
bool clip_view_has_locked_selection(const bContext *C)
void clip_graph_tracking_values_iterate(SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
void CLIP_OT_select_grouped(wmOperatorType *ot)
void clip_view_offset_for_center_to_point(SpaceClip *sc, float x, float y, float *r_offset_x, float *r_offset_y)
void clip_draw_grease_pencil(bContext *C, int onlyv2d)
void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region)
void CLIP_OT_delete_track(wmOperatorType *ot)
void CLIP_OT_add_marker(wmOperatorType *ot)
void clip_start_prefetch_job(const bContext *C)
void clip_graph_tracking_iterate(SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void(*func)(void *userdata, MovieTrackingMarker *marker))
void CLIP_OT_select(wmOperatorType *ot)
eClipCurveValueSource
@ CLIP_VALUE_SOURCE_REPROJECTION_ERROR
@ CLIP_VALUE_SOURCE_SPEED_Y
@ CLIP_VALUE_SOURCE_SPEED_X
void CLIP_OT_graph_select(wmOperatorType *ot)
void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track)
void CLIP_OT_update_image_from_plane_marker(wmOperatorType *ot)
void clip_draw_graph(SpaceClip *sc, ARegion *region, Scene *scene)
void(*)(void *userdata, eClipCurveValueSource value_source) ClipTrackValueSegmentEndCallback
void CLIP_OT_view_pan(wmOperatorType *ot)
Definition clip_ops.cc:508
void CLIP_OT_graph_select_box(wmOperatorType *ot)
void CLIP_OT_view_all(wmOperatorType *ot)
Definition clip_ops.cc:973
void CLIP_OT_tracking_object_remove(wmOperatorType *ot)
void CLIP_OT_disable_markers(wmOperatorType *ot)
void CLIP_OT_set_plane(wmOperatorType *ot)
void(*)(void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, eClipCurveValueSource value_source, int scene_framenr, float val) ClipTrackValueCallback
void CLIP_OT_graph_view_all(wmOperatorType *ot)
void CLIP_OT_new_image_from_plane_marker(wmOperatorType *ot)
void CLIP_OT_reload(wmOperatorType *ot)
Definition clip_ops.cc:350
void CLIP_OT_graph_disable_markers(wmOperatorType *ot)
void CLIP_OT_clear_track_path(wmOperatorType *ot)
void CLIP_OT_frame_jump(wmOperatorType *ot)
MovieTrackingTrack * active_track
wmOperatorType * ot
Definition wm_files.cc:4237