Blender V5.3
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
14namespace blender {
15
16struct ARegion;
17struct ARegionType;
18struct MovieClip;
21struct Scene;
22struct SpaceClip;
23struct bContext;
24struct wmOperatorType;
25
26/* channel heights */
27#define CHANNEL_FIRST (-UI_TIME_SCRUB_MARGIN_Y - CHANNEL_HEIGHT_HALF - CHANNEL_SKIP)
28#define CHANNEL_HEIGHT (0.8f * U.widget_unit)
29#define CHANNEL_HEIGHT_HALF (0.4f * U.widget_unit)
30#define CHANNEL_SKIP (0.1f * U.widget_unit)
31#define CHANNEL_STEP (CHANNEL_HEIGHT + CHANNEL_SKIP)
32
33#define CHANNEL_PAD 4
34
35/* extra padding for lengths (to go under scrollers) */
36#define EXTRA_SCROLL_PAD 100.0f
37
38#define STRIP_HEIGHT_HALF (0.25f * UI_UNIT_Y)
39
40/* internal exports only */
41
42/* clip_buttons.cc */
43
44void ED_clip_buttons_register(ARegionType *art);
45
46/* clip_dopesheet_draw.cc */
47
48void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene);
49void clip_draw_dopesheet_channels(const bContext *C, ARegion *region);
50
51/* clip_dopesheet_ops.cc */
52
53void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot);
54void CLIP_OT_dopesheet_view_all(wmOperatorType *ot);
55
56/* clip_draw.cc */
57
58void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region);
59
60/* draw grease pencil */
61
62void clip_draw_grease_pencil(bContext *C, int onlyv2d);
63void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region);
64
65/* clip_editor.cc */
66
67void clip_start_prefetch_job(const bContext *C);
68
69/* clip_graph_draw.cc */
70
71void clip_draw_graph(SpaceClip *sc, ARegion *region, Scene *scene);
72
73/* clip_graph_ops.cc */
74
75void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region);
76
77void CLIP_OT_graph_select(wmOperatorType *ot);
78void CLIP_OT_graph_select_box(wmOperatorType *ot);
79void CLIP_OT_graph_select_all_markers(wmOperatorType *ot);
80void CLIP_OT_graph_delete_curve(wmOperatorType *ot);
81void CLIP_OT_graph_delete_knot(wmOperatorType *ot);
82void CLIP_OT_graph_view_all(wmOperatorType *ot);
83void CLIP_OT_graph_center_current_frame(wmOperatorType *ot);
84void CLIP_OT_graph_disable_markers(wmOperatorType *ot);
85
86/* clip_ops.cc */
87
88void CLIP_OT_open(wmOperatorType *ot);
89void CLIP_OT_reload(wmOperatorType *ot);
90void CLIP_OT_view_pan(wmOperatorType *ot);
91void CLIP_OT_view_zoom(wmOperatorType *ot);
92void CLIP_OT_view_zoom_in(wmOperatorType *ot);
93void CLIP_OT_view_zoom_out(wmOperatorType *ot);
94void CLIP_OT_view_zoom_ratio(wmOperatorType *ot);
95void CLIP_OT_view_all(wmOperatorType *ot);
96void CLIP_OT_view_selected(wmOperatorType *ot);
97void CLIP_OT_view_center_cursor(wmOperatorType *ot);
98void CLIP_OT_change_frame(wmOperatorType *ot);
99void CLIP_OT_rebuild_proxy(wmOperatorType *ot);
100void CLIP_OT_mode_set(wmOperatorType *ot);
101
102#ifdef WITH_INPUT_NDOF
103void CLIP_OT_view_ndof(wmOperatorType *ot);
104#endif
105
106void CLIP_OT_prefetch(wmOperatorType *ot);
107
108void CLIP_OT_set_scene_frames(wmOperatorType *ot);
109
110void CLIP_OT_cursor_set(wmOperatorType *ot);
111
112void CLIP_OT_lock_selection_toggle(wmOperatorType *ot);
113
114/* clip_utils.cc */
115
121
122using ClipTrackValueCallback = void (*)(void *userdata,
123 MovieTrackingTrack *track,
124 MovieTrackingMarker *marker,
125 eClipCurveValueSource value_source,
126 int scene_framenr,
127 float val);
128
129using ClipTrackValueSegmentStartCallback = void (*)(void *userdata,
130 MovieTrackingTrack *track,
131 eClipCurveValueSource value_source,
132 bool is_point);
133
134using ClipTrackValueSegmentEndCallback = void (*)(void *userdata,
135 eClipCurveValueSource value_source);
136
138
140 MovieTrackingTrack *track,
141 void *userdata,
145
147 bool selected_only,
148 bool include_hidden,
149 void *userdata,
153
155 bool selected_only,
156 bool include_hidden,
157 void *userdata,
158 void (*func)(void *userdata, MovieTrackingMarker *marker));
159
162 MovieClip *clip,
163 MovieTrackingTrack *track,
164 MovieTrackingMarker *marker);
165
167
172 SpaceClip *sc, float x, float y, float *r_offset_x, float *r_offset_y);
173void clip_view_center_to_point(SpaceClip *sc, float x, float y);
174
176 const bContext *C, bool fit, float *r_offset_x, float *r_offset_y, float *r_zoom);
177
183
184/* tracking_ops.cc */
185
186/* Find track which can be slid in a proximity of the given event.
187 * Uses the same distance tolerance rule as the "Slide Marker" operator. */
189
194
199
203
208
210
217
219
222
224
228
232
234
237
240
243
246
249
250/* tracking_select.cc */
251
258
259/* -------------------------------------------------------------------- */
262
263/* Check whether the marker can is visible within the given context.
264 * The track must be visible, and no restrictions from the clip editor are to be in effect on the
265 * disabled marker visibility (unless the track is active). */
267 const MovieTrackingObject *tracking_object,
268 const MovieTrackingTrack *track,
269 const MovieTrackingMarker *marker)
270{
271 if (track->flag & TRACK_HIDDEN) {
272 return false;
273 }
274
275 if ((marker->flag & MARKER_DISABLED) == 0) {
276 return true;
277 }
278
279 if ((space_clip->flag & SC_HIDE_DISABLED) == 0) {
280 return true;
281 }
282
283 return track == tracking_object->active_track;
284}
285
287
288} // namespace blender
#define C
Definition RandGen.cpp:29
#define BLI_INLINE
Definition scene.h:133
BMesh Iterators.
void clip_delete_plane_track(bContext *C, MovieClip *clip, MovieTrackingPlaneTrack *plane_track)
void CLIP_OT_add_marker(wmOperatorType *ot)
void CLIP_OT_create_plane_track(wmOperatorType *ot)
void CLIP_OT_graph_select_all_markers(wmOperatorType *ot)
void(*)(void *userdata, eClipCurveValueSource value_source) ClipTrackValueSegmentEndCallback
void CLIP_OT_stabilize_2d_add(wmOperatorType *ot)
void CLIP_OT_change_frame(wmOperatorType *ot)
Definition clip_ops.cc:1164
void CLIP_OT_keyframe_insert(wmOperatorType *ot)
void clip_draw_graph(SpaceClip *sc, ARegion *region, Scene *scene)
void CLIP_OT_tracking_object_remove(wmOperatorType *ot)
void CLIP_OT_keyframe_delete(wmOperatorType *ot)
void CLIP_OT_average_tracks(wmOperatorType *ot)
void CLIP_OT_track_markers(wmOperatorType *ot)
void CLIP_OT_join_tracks(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_rotation_add(wmOperatorType *ot)
void CLIP_OT_clear_solution(wmOperatorType *ot)
void CLIP_OT_solve_camera(wmOperatorType *ot)
void CLIP_OT_copy_tracks(wmOperatorType *ot)
void CLIP_OT_lock_tracks(wmOperatorType *ot)
void CLIP_OT_rebuild_proxy(wmOperatorType *ot)
Definition clip_ops.cc:1574
void CLIP_OT_select_grouped(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_select(wmOperatorType *ot)
void CLIP_OT_hide_tracks(wmOperatorType *ot)
void CLIP_OT_view_selected(wmOperatorType *ot)
Definition clip_ops.cc:1045
void CLIP_OT_slide_marker(wmOperatorType *ot)
void CLIP_OT_set_plane(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_tracking_object_new(wmOperatorType *ot)
bool clip_graph_value_visible(SpaceClip *sc, eClipCurveValueSource value_source)
Definition clip_utils.cc:41
void CLIP_OT_frame_jump(wmOperatorType *ot)
void CLIP_OT_slide_plane_marker(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_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack *track, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
void CLIP_OT_mode_set(wmOperatorType *ot)
Definition clip_ops.cc:1612
void CLIP_OT_view_zoom_in(wmOperatorType *ot)
Definition clip_ops.cc:782
eClipCurveValueSource
@ CLIP_VALUE_SOURCE_SPEED_Y
@ CLIP_VALUE_SOURCE_SPEED_X
@ CLIP_VALUE_SOURCE_REPROJECTION_ERROR
void CLIP_OT_select_lasso(wmOperatorType *ot)
void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track)
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_OT_graph_select(wmOperatorType *ot)
void CLIP_OT_add_marker_at_click(wmOperatorType *ot)
void CLIP_OT_detect_features(wmOperatorType *ot)
void CLIP_OT_delete_track(wmOperatorType *ot)
MovieTrackingTrack * tracking_find_slidable_track_in_proximity(bContext *C, const float co[2])
void CLIP_OT_prefetch(wmOperatorType *ot)
Definition clip_ops.cc:1724
void CLIP_OT_apply_solution_scale(wmOperatorType *ot)
void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region)
void CLIP_OT_view_center_cursor(wmOperatorType *ot)
Definition clip_ops.cc:1013
void CLIP_OT_stabilize_2d_rotation_remove(wmOperatorType *ot)
void ED_clip_buttons_register(ARegionType *art)
void CLIP_OT_stabilize_2d_rotation_select(wmOperatorType *ot)
void clip_draw_grease_pencil(bContext *C, int onlyv2d)
void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region)
void CLIP_OT_graph_center_current_frame(wmOperatorType *ot)
bool clip_view_has_locked_selection(const bContext *C)
void CLIP_OT_open(wmOperatorType *ot)
Definition clip_ops.cc:304
void CLIP_OT_graph_view_all(wmOperatorType *ot)
void CLIP_OT_clear_track_path(wmOperatorType *ot)
void CLIP_OT_select(wmOperatorType *ot)
void clip_graph_tracking_iterate(SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void(*func)(void *userdata, MovieTrackingMarker *marker))
void CLIP_OT_view_zoom_out(wmOperatorType *ot)
Definition clip_ops.cc:839
void CLIP_OT_view_zoom(wmOperatorType *ot)
Definition clip_ops.cc:716
void(*)(void *userdata, MovieTrackingTrack *track, eClipCurveValueSource value_source, bool is_point) ClipTrackValueSegmentStartCallback
void CLIP_OT_select_all(wmOperatorType *ot)
void CLIP_OT_view_all(wmOperatorType *ot)
Definition clip_ops.cc:974
void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
Definition clip_ops.cc:891
void CLIP_OT_paste_tracks(wmOperatorType *ot)
void CLIP_OT_refine_markers(wmOperatorType *ot)
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_stabilize_2d_remove(wmOperatorType *ot)
void CLIP_OT_new_image_from_plane_marker(wmOperatorType *ot)
void CLIP_OT_reload(wmOperatorType *ot)
Definition clip_ops.cc:351
void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot)
void CLIP_OT_set_solver_keyframe(wmOperatorType *ot)
void CLIP_OT_set_origin(wmOperatorType *ot)
void CLIP_OT_set_scale(wmOperatorType *ot)
void clip_delete_marker(bContext *C, MovieClip *clip, MovieTrackingTrack *track, MovieTrackingMarker *marker)
void CLIP_OT_set_solution_scale(wmOperatorType *ot)
void CLIP_OT_delete_marker(wmOperatorType *ot)
void CLIP_OT_update_image_from_plane_marker(wmOperatorType *ot)
void CLIP_OT_track_copy_color(wmOperatorType *ot)
void(*)(void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, eClipCurveValueSource value_source, int scene_framenr, float val) ClipTrackValueCallback
void CLIP_OT_disable_markers(wmOperatorType *ot)
void CLIP_OT_graph_select_box(wmOperatorType *ot)
void CLIP_OT_lock_selection_toggle(wmOperatorType *ot)
Definition clip_ops.cc:1867
void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
void CLIP_OT_set_scene_frames(wmOperatorType *ot)
Definition clip_ops.cc:1765
void CLIP_OT_dopesheet_view_all(wmOperatorType *ot)
void CLIP_OT_select_box(wmOperatorType *ot)
void CLIP_OT_graph_delete_curve(wmOperatorType *ot)
void CLIP_OT_clean_tracks(wmOperatorType *ot)
void CLIP_OT_set_axis(wmOperatorType *ot)
void CLIP_OT_graph_disable_markers(wmOperatorType *ot)
void CLIP_OT_select_circle(wmOperatorType *ot)
void CLIP_OT_cursor_set(wmOperatorType *ot)
Definition clip_ops.cc:1817
void clip_start_prefetch_job(const bContext *C)
void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region)
void clip_view_center_to_point(SpaceClip *sc, float x, float y)
void CLIP_OT_hide_tracks_clear(wmOperatorType *ot)
void CLIP_OT_graph_delete_knot(wmOperatorType *ot)
void CLIP_OT_view_pan(wmOperatorType *ot)
Definition clip_ops.cc:509
void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene)
MovieTrackingTrack * active_track
eSpaceClip_Flag flag