Commit: e4996b49f5e0cdf9caacaae50e284e51d8250136
Author: Sergey Sharybin
Date:   Fri Feb 28 19:05:09 2014 +0600
https://developer.blender.org/rBe4996b49f5e0cdf9caacaae50e284e51d8250136

Proper solution for crash of GP when marker is not exist on current frame

===================================================================

M       source/blender/editors/gpencil/gpencil_paint.c
M       source/blender/editors/space_clip/clip_draw.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index d808c91..05d5645 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -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];
diff --git a/source/blender/editors/space_clip/clip_draw.c 
b/source/blender/editors/space_clip/clip_draw.c
index 8c015a7..d8ccac7 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -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;
                }
 
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to