diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-20 14:42:41 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-20 14:42:41 +0400 |
commit | b07edbc6d6f3796fbf3d036582a1beec35e08a59 (patch) | |
tree | d18b5633ed2da310aaf942ddf8c39180eef30f82 /source/blender | |
parent | 4b955a60eda06526e3a793fd9bb3c942b641d877 (diff) |
Grease pencil and manual calibration weren't aware of clip start frame
Diffstat (limited to 'source/blender')
4 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 6d90824668e..12b002ef612 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -56,6 +56,7 @@ #include "ED_gpencil.h" #include "ED_screen.h" #include "ED_view3d.h" +#include "ED_clip.h" #include "BIF_gl.h" #include "BIF_glutil.h" @@ -1032,8 +1033,9 @@ static int gp_session_initdata(bContext *C, tGPsdata *p) p->custom_color[3] = 0.9f; if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) { - int framenr = sc->user.framenr; - MovieTrackingTrack *track = BKE_tracking_track_get_active(&sc->clip->tracking); + MovieClip *clip = ED_space_clip_get_clip(sc); + int framenr = ED_space_clip_get_clip_frame_number(sc); + MovieTrackingTrack *track = BKE_tracking_track_get_active(&clip->tracking); MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, framenr); p->imat[3][0] -= marker->pos[0]; diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 936c462a161..5d187680b38 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -1318,7 +1318,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, MovieTrackingTrack *track = BKE_tracking_track_get_active(&sc->clip->tracking); if (track) { - int framenr = sc->user.framenr; + int framenr = ED_space_clip_get_clip_frame_number(sc); MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, framenr); offsx = marker->pos[0]; @@ -1496,7 +1496,7 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d) MovieTrackingTrack *track = BKE_tracking_track_get_active(&sc->clip->tracking); if (track) { - int framenr = sc->user.framenr; + int framenr = ED_space_clip_get_clip_frame_number(sc); /* don't get the exact marker since it may not exist for the frame */ MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr); if (marker) { diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 6aacd4d5450..b57b16707d4 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -265,6 +265,7 @@ static int selected_boundbox(const bContext *C, float min[2], float max[2]) MovieTrackingTrack *track; int width, height, ok = FALSE; ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); + int framenr = ED_space_clip_get_clip_frame_number(sc); INIT_MINMAX2(min, max); @@ -273,7 +274,7 @@ static int selected_boundbox(const bContext *C, float min[2], float max[2]) track = tracksbase->first; while (track) { if (TRACK_VIEW_SELECTED(sc, track)) { - MovieTrackingMarker *marker = BKE_tracking_marker_get(track, sc->user.framenr); + MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr); if (marker) { float pos[3]; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 0ecfa2695e0..9f335b4afe7 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -643,7 +643,7 @@ static void recalcData_spaceclip(TransInfo *t) MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); MovieTrackingTrack *track; - int framenr = sc->user.framenr; + int framenr = ED_space_clip_get_clip_frame_number(sc); flushTransTracking(t); |