diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-20 14:54:56 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-20 14:54:56 +0400 |
commit | 470ad6fc0e729e335718d1152e2348db159e4514 (patch) | |
tree | 60ab5ebe8ce11cc193e28d9b599da5cbdd072d65 /source/blender/editors/mask/mask_relationships.c | |
parent | b07edbc6d6f3796fbf3d036582a1beec35e08a59 (diff) |
Do not check result of BKE_tracking_marker_get -- it shall always
return valid marker. If not -- let blender crash, because that means
something went really bad and silencing this isn't good idea.
Also made mask parenting to tracking data aware of clip's start frame.
Diffstat (limited to 'source/blender/editors/mask/mask_relationships.c')
-rw-r--r-- | source/blender/editors/mask/mask_relationships.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/mask/mask_relationships.c b/source/blender/editors/mask/mask_relationships.c index 7ba3c27e18d..a1f2539ce7c 100644 --- a/source/blender/editors/mask/mask_relationships.c +++ b/source/blender/editors/mask/mask_relationships.c @@ -44,6 +44,7 @@ #include "WM_types.h" #include "ED_screen.h" +#include "ED_clip.h" /* frame remapping functions */ #include "ED_mask.h" /* own include */ #include "mask_intern.h" /* own include */ @@ -104,21 +105,25 @@ static int mask_parent_set_exec(bContext *C, wmOperator *UNUSED(op)) MovieClip *clip; MovieTrackingTrack *track; MovieTrackingMarker *marker; - MovieTrackingObject *tracking; + MovieTrackingObject *tracking_object; /* done */ + int framenr; + float marker_pos_ofs[2]; float parmask_pos[2]; if ((NULL == (sc = CTX_wm_space_clip(C))) || (NULL == (clip = sc->clip)) || (NULL == (track = clip->tracking.act_track)) || - (NULL == (marker = BKE_tracking_marker_get(track, sc->user.framenr))) || - (NULL == (tracking = BKE_tracking_object_get_active(&clip->tracking)))) + (NULL == (tracking_object = BKE_tracking_object_get_active(&clip->tracking)))) { return OPERATOR_CANCELLED; } + framenr = ED_space_clip_get_clip_frame_number(sc); + marker = BKE_tracking_marker_get(track, framenr); + add_v2_v2v2(marker_pos_ofs, marker->pos, track->offset); BKE_mask_coord_from_movieclip(clip, &sc->user, parmask_pos, marker_pos_ofs); @@ -138,7 +143,7 @@ static int mask_parent_set_exec(bContext *C, wmOperator *UNUSED(op)) if (MASKPOINT_ISSEL_ANY(point)) { point->parent.id_type = ID_MC; point->parent.id = &clip->id; - strcpy(point->parent.parent, tracking->name); + strcpy(point->parent.parent, tracking_object->name); strcpy(point->parent.sub_parent, track->name); copy_v2_v2(point->parent.parent_orig, parmask_pos); |