Proper solution for crash of GP when marker is not exist on current frame
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 28 Feb 2014 13:05:09 +0000 (19:05 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 28 Feb 2014 13:05:38 +0000 (19:05 +0600)
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/space_clip/clip_draw.c

index d808c91d4e7de9bbdf6862ec7629a472e170864f..05d56458a3f7c2065be209cba9bef4447e13c0cf 100644 (file)
@@ -1145,7 +1145,7 @@ static int gp_session_initdata(bContext *C, tGPsdata *p)
                                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);
+                               MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
                                
                                p->imat[3][0] -= marker->pos[0];
                                p->imat[3][1] -= marker->pos[1];
index 8c015a71d30a9dd4065e5c617cd25ef45bfbc0fc..d8ccac730c8e749bbb8eefb2ae0c2d2f5ada92cc 100644 (file)
@@ -1635,14 +1635,12 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
 
                if (track) {
                        int framenr = ED_space_clip_get_clip_frame_number(sc);
-                       MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, framenr);
+                       MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
 
-                       if (marker) {
-                               offsx = marker->pos[0];
-                               offsy = marker->pos[1];
+                       offsx = marker->pos[0];
+                       offsy = marker->pos[1];
 
-                               gpd = track->gpd;
-                       }
+                       gpd = track->gpd;
                }
 
        }