Blender  V2.93
clip_intern.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2011 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 struct ARegion;
27 struct MovieClip;
28 struct MovieTrackingMarker;
29 struct MovieTrackingTrack;
30 struct Scene;
31 struct ScrArea;
32 struct SpaceClip;
33 struct bContext;
34 struct wmOperatorType;
35 
36 /* channel heights */
37 #define CHANNEL_FIRST (-UI_TIME_SCRUB_MARGIN_Y - CHANNEL_HEIGHT_HALF - CHANNEL_SKIP)
38 #define CHANNEL_HEIGHT (0.8f * U.widget_unit)
39 #define CHANNEL_HEIGHT_HALF (0.4f * U.widget_unit)
40 #define CHANNEL_SKIP (0.1f * U.widget_unit)
41 #define CHANNEL_STEP (CHANNEL_HEIGHT + CHANNEL_SKIP)
42 
43 #define CHANNEL_PAD 4
44 
45 /* extra padding for lengths (to go under scrollers) */
46 #define EXTRA_SCROLL_PAD 100.0f
47 
48 #define STRIP_HEIGHT_HALF (0.25f * UI_UNIT_Y)
49 
50 /* internal exports only */
51 
52 /* clip_buttons.c */
53 void ED_clip_buttons_register(struct ARegionType *art);
54 
55 /* clip_dopesheet_draw.c */
56 void clip_draw_dopesheet_main(struct SpaceClip *sc, struct ARegion *region, struct Scene *scene);
57 void clip_draw_dopesheet_channels(const struct bContext *C, struct ARegion *region);
58 
59 /* clip_dopesheet_ops.c */
62 
63 /* clip_draw.c */
64 void clip_draw_main(const struct bContext *C, struct SpaceClip *sc, struct ARegion *region);
65 void clip_draw_grease_pencil(struct bContext *C, int onlyv2d);
66 void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region);
67 
68 /* clip_editor.c */
69 void clip_start_prefetch_job(const struct bContext *C);
70 
71 /* clip_graph_draw.c */
72 void clip_draw_graph(struct SpaceClip *sc, struct ARegion *region, struct Scene *scene);
73 
74 /* clip_graph_ops.c */
75 void ED_clip_graph_center_current_frame(struct Scene *scene, struct ARegion *region);
76 
85 
86 /* clip_ops.c */
87 void CLIP_OT_open(struct wmOperatorType *ot);
88 void CLIP_OT_reload(struct wmOperatorType *ot);
89 void CLIP_OT_view_pan(struct wmOperatorType *ot);
94 void CLIP_OT_view_all(struct wmOperatorType *ot);
99 void CLIP_OT_mode_set(struct wmOperatorType *ot);
100 
101 #ifdef WITH_INPUT_NDOF
102 void CLIP_OT_view_ndof(struct wmOperatorType *ot);
103 #endif
104 
105 void CLIP_OT_prefetch(struct wmOperatorType *ot);
106 
108 
109 void CLIP_OT_cursor_set(struct wmOperatorType *ot);
110 
112 
113 /* clip_toolbar.c */
115 
116 /* clip_utils.c */
117 
118 typedef enum {
123 
124 typedef void (*ClipTrackValueCallback)(void *userdata,
125  struct MovieTrackingTrack *track,
126  struct MovieTrackingMarker *marker,
127  eClipCurveValueSource value_source,
128  int scene_framenr,
129  float val);
130 
131 typedef void (*ClipTrackValueSegmentStartCallback)(void *userdata,
132  struct MovieTrackingTrack *track,
133  eClipCurveValueSource value_source,
134  bool is_point);
135 
136 typedef void (*ClipTrackValueSegmentEndCallback)(void *userdata,
137  eClipCurveValueSource value_source);
138 
139 bool clip_graph_value_visible(struct SpaceClip *sc, eClipCurveValueSource value_source);
140 
142  struct MovieTrackingTrack *track,
143  void *userdata,
147 
149  bool selected_only,
150  bool include_hidden,
151  void *userdata,
155 
157  bool selected_only,
158  bool include_hidden,
159  void *userdata,
160  void (*func)(void *userdata, struct MovieTrackingMarker *marker));
161 
162 void clip_delete_track(struct bContext *C,
163  struct MovieClip *clip,
164  struct MovieTrackingTrack *track);
165 void clip_delete_marker(struct bContext *C,
166  struct MovieClip *clip,
167  struct MovieTrackingTrack *track,
168  struct MovieTrackingMarker *marker);
169 
170 void clip_delete_plane_track(struct bContext *C,
171  struct MovieClip *clip,
172  struct MovieTrackingPlaneTrack *plane_track);
173 
175  SpaceClip *sc, const float x, const float y, float *r_offset_x, float *r_offset_y);
176 void clip_view_center_to_point(SpaceClip *sc, float x, float y);
177 
179  const struct bContext *C, bool fit, float *r_offset_x, float *r_offset_y, float *r_zoom);
180 
182 
183 void clip_draw_sfra_efra(struct View2D *v2d, struct Scene *scene);
184 
185 /* tracking_ops.c */
187  struct bContext *C, const struct wmEvent *event, int *r_area, int *r_action, int *r_corner);
188 
189 void CLIP_OT_add_marker(struct wmOperatorType *ot);
193 
198 
202 
207 
209 
210 void CLIP_OT_set_origin(struct wmOperatorType *ot);
211 void CLIP_OT_set_plane(struct wmOperatorType *ot);
212 void CLIP_OT_set_axis(struct wmOperatorType *ot);
213 void CLIP_OT_set_scale(struct wmOperatorType *ot);
216 
218 
220 
221 void CLIP_OT_frame_jump(struct wmOperatorType *ot);
223 
225 
229 
233 
235 
238 
241 
244 
247 
248 /* tracking_select.c */
249 void CLIP_OT_select(struct wmOperatorType *ot);
250 void CLIP_OT_select_all(struct wmOperatorType *ot);
251 void CLIP_OT_select_box(struct wmOperatorType *ot);
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define C
Definition: RandGen.cpp:39
void CLIP_OT_tracking_object_remove(struct wmOperatorType *ot)
void CLIP_OT_graph_delete_curve(struct wmOperatorType *ot)
void CLIP_OT_frame_jump(struct wmOperatorType *ot)
void CLIP_OT_hide_tracks(struct wmOperatorType *ot)
void CLIP_OT_select_circle(struct wmOperatorType *ot)
void CLIP_OT_set_axis(struct wmOperatorType *ot)
void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region)
Definition: clip_draw.c:1974
void CLIP_OT_view_zoom_out(struct wmOperatorType *ot)
Definition: clip_ops.c:837
void CLIP_OT_view_center_cursor(struct wmOperatorType *ot)
Definition: clip_ops.c:1009
void CLIP_OT_stabilize_2d_add(struct wmOperatorType *ot)
void clip_graph_tracking_values_iterate_track(struct SpaceClip *sc, struct MovieTrackingTrack *track, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
Definition: clip_utils.c:253
void clip_draw_graph(struct SpaceClip *sc, struct ARegion *region, struct Scene *scene)
void CLIP_OT_track_copy_color(struct wmOperatorType *ot)
void(* ClipTrackValueSegmentStartCallback)(void *userdata, struct MovieTrackingTrack *track, eClipCurveValueSource value_source, bool is_point)
Definition: clip_intern.h:131
void CLIP_OT_set_scale(struct wmOperatorType *ot)
void clip_delete_marker(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker)
Definition: clip_utils.c:366
void CLIP_OT_set_solution_scale(struct wmOperatorType *ot)
void CLIP_OT_graph_select(struct wmOperatorType *ot)
void CLIP_OT_view_all(struct wmOperatorType *ot)
Definition: clip_ops.c:971
void CLIP_OT_view_zoom_in(struct wmOperatorType *ot)
Definition: clip_ops.c:780
void CLIP_OT_clean_tracks(struct wmOperatorType *ot)
void CLIP_OT_view_zoom(wmOperatorType *ot)
Definition: clip_ops.c:714
void CLIP_OT_clear_solution(struct wmOperatorType *ot)
void CLIP_OT_reload(struct wmOperatorType *ot)
Definition: clip_ops.c:357
void clip_delete_track(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track)
Definition: clip_utils.c:327
void ED_clip_graph_center_current_frame(struct Scene *scene, struct ARegion *region)
struct MovieTrackingTrack * tracking_marker_check_slide(struct bContext *C, const struct wmEvent *event, int *r_area, int *r_action, int *r_corner)
void CLIP_OT_solve_camera(struct wmOperatorType *ot)
void CLIP_OT_lock_selection_toggle(struct wmOperatorType *ot)
Definition: clip_ops.c:1856
void CLIP_OT_add_marker_at_click(struct wmOperatorType *ot)
Definition: tracking_ops.c:199
void CLIP_OT_delete_track(struct wmOperatorType *ot)
Definition: tracking_ops.c:252
void(* ClipTrackValueSegmentEndCallback)(void *userdata, eClipCurveValueSource value_source)
Definition: clip_intern.h:136
void CLIP_OT_select_lasso(struct wmOperatorType *ot)
void CLIP_OT_graph_view_all(struct wmOperatorType *ot)
void CLIP_OT_dopesheet_view_all(struct wmOperatorType *ot)
void CLIP_OT_graph_select_box(struct wmOperatorType *ot)
void CLIP_OT_view_zoom_ratio(struct wmOperatorType *ot)
Definition: clip_ops.c:889
void CLIP_OT_set_scene_frames(wmOperatorType *ot)
Definition: clip_ops.c:1758
void CLIP_OT_change_frame(wmOperatorType *ot)
Definition: clip_ops.c:1156
void CLIP_OT_select_grouped(struct wmOperatorType *ot)
void CLIP_OT_average_tracks(struct wmOperatorType *ot)
void clip_graph_tracking_values_iterate(struct SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
Definition: clip_utils.c:267
void ED_clip_buttons_register(struct ARegionType *art)
Definition: clip_buttons.c:86
void CLIP_OT_mode_set(struct wmOperatorType *ot)
Definition: clip_ops.c:1612
void clip_start_prefetch_job(const struct bContext *C)
void CLIP_OT_select(struct wmOperatorType *ot)
struct ARegion * ED_clip_has_properties_region(struct ScrArea *area)
Definition: clip_toolbar.c:44
bool clip_graph_value_visible(struct SpaceClip *sc, eClipCurveValueSource value_source)
Definition: clip_utils.c:58
void CLIP_OT_stabilize_2d_rotation_select(struct wmOperatorType *ot)
void CLIP_OT_open(struct wmOperatorType *ot)
Definition: clip_ops.c:310
void clip_view_center_to_point(SpaceClip *sc, float x, float y)
Definition: clip_utils.c:415
void clip_draw_main(const struct bContext *C, struct SpaceClip *sc, struct ARegion *region)
void CLIP_OT_refine_markers(struct wmOperatorType *ot)
void CLIP_OT_set_solver_keyframe(struct wmOperatorType *ot)
void CLIP_OT_tracking_object_new(struct wmOperatorType *ot)
void CLIP_OT_disable_markers(struct wmOperatorType *ot)
bool clip_view_has_locked_selection(const struct bContext *C)
void CLIP_OT_clear_track_path(struct wmOperatorType *ot)
bool clip_view_calculate_view_selection(const struct bContext *C, bool fit, float *r_offset_x, float *r_offset_y, float *r_zoom)
void CLIP_OT_track_markers(struct wmOperatorType *ot)
void CLIP_OT_delete_marker(struct wmOperatorType *ot)
Definition: tracking_ops.c:321
void CLIP_OT_graph_select_all_markers(struct wmOperatorType *ot)
void CLIP_OT_detect_features(struct wmOperatorType *ot)
void CLIP_OT_cursor_set(struct wmOperatorType *ot)
Definition: clip_ops.c:1806
void CLIP_OT_apply_solution_scale(struct wmOperatorType *ot)
void clip_draw_dopesheet_main(struct SpaceClip *sc, struct ARegion *region, struct Scene *scene)
void CLIP_OT_rebuild_proxy(struct wmOperatorType *ot)
Definition: clip_ops.c:1575
void CLIP_OT_set_origin(struct wmOperatorType *ot)
void CLIP_OT_slide_marker(struct wmOperatorType *ot)
Definition: tracking_ops.c:975
void clip_draw_grease_pencil(struct bContext *C, int onlyv2d)
Definition: clip_draw.c:1985
void CLIP_OT_select_box(struct wmOperatorType *ot)
void clip_draw_dopesheet_channels(const struct bContext *C, struct ARegion *region)
void CLIP_OT_view_selected(struct wmOperatorType *ot)
Definition: clip_ops.c:1041
void clip_graph_tracking_iterate(struct SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void(*func)(void *userdata, struct MovieTrackingMarker *marker))
void CLIP_OT_stabilize_2d_rotation_remove(struct wmOperatorType *ot)
void CLIP_OT_create_plane_track(struct wmOperatorType *ot)
void CLIP_OT_slide_plane_marker(struct wmOperatorType *ot)
void CLIP_OT_stabilize_2d_select(struct wmOperatorType *ot)
void CLIP_OT_add_marker(struct wmOperatorType *ot)
Definition: tracking_ops.c:122
void CLIP_OT_hide_tracks_clear(struct wmOperatorType *ot)
eClipCurveValueSource
Definition: clip_intern.h:118
@ CLIP_VALUE_SOURCE_REPROJECTION_ERROR
Definition: clip_intern.h:121
@ CLIP_VALUE_SOURCE_SPEED_Y
Definition: clip_intern.h:120
@ CLIP_VALUE_SOURCE_SPEED_X
Definition: clip_intern.h:119
void CLIP_OT_prefetch(struct wmOperatorType *ot)
Definition: clip_ops.c:1718
void CLIP_OT_paste_tracks(struct wmOperatorType *ot)
void CLIP_OT_dopesheet_select_channel(struct wmOperatorType *ot)
void CLIP_OT_stabilize_2d_rotation_add(struct wmOperatorType *ot)
void CLIP_OT_graph_center_current_frame(struct wmOperatorType *ot)
void CLIP_OT_graph_delete_knot(struct wmOperatorType *ot)
void clip_delete_plane_track(struct bContext *C, struct MovieClip *clip, struct MovieTrackingPlaneTrack *plane_track)
Definition: clip_utils.c:381
void CLIP_OT_lock_tracks(struct wmOperatorType *ot)
void CLIP_OT_select_all(struct wmOperatorType *ot)
void CLIP_OT_copy_tracks(struct wmOperatorType *ot)
void CLIP_OT_set_plane(struct wmOperatorType *ot)
void CLIP_OT_view_pan(struct wmOperatorType *ot)
Definition: clip_ops.c:511
void(* ClipTrackValueCallback)(void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, eClipCurveValueSource value_source, int scene_framenr, float val)
Definition: clip_intern.h:124
void CLIP_OT_graph_disable_markers(struct wmOperatorType *ot)
void clip_view_offset_for_center_to_point(SpaceClip *sc, const float x, const float y, float *r_offset_x, float *r_offset_y)
Definition: clip_utils.c:402
void CLIP_OT_set_center_principal(struct wmOperatorType *ot)
void CLIP_OT_stabilize_2d_remove(struct wmOperatorType *ot)
void CLIP_OT_keyframe_delete(struct wmOperatorType *ot)
void CLIP_OT_join_tracks(struct wmOperatorType *ot)
void CLIP_OT_keyframe_insert(struct wmOperatorType *ot)
void clip_draw_sfra_efra(struct View2D *v2d, struct Scene *scene)
Definition: clip_utils.c:628
Scene scene
static void area(int d1, int d2, int e1, int e2, float weights[2])
wmOperatorType * ot
Definition: wm_files.c:3156