diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-05 22:57:17 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-05 22:57:17 +0400 |
commit | 9355cc5c399a9d7cd49815c68eeeac788022ba1a (patch) | |
tree | c4b9c3c19e31b7a06f98486fcbb85008dc51ca5c /source/blender/editors/space_clip/clip_graph_ops.c | |
parent | f55f9e95db44838130a18f80b33bd77f58e8a987 (diff) |
Object tracking; initial commit
This commit implements basis stuff needed for object tracking,
use case isn't perfect now, interface also should be cleaned a bit.
- Added list of objects to be tracked. Default there's only one object called
"Camera" which is used for solving camera motion. Other objects can be added
and each of them will have it;s own list of tracks. Only one object can be used
for camera solving at this moment.
- Added new constraint called "Object Tracking" which makes oriented object be
moving in the save way as solved object motion.
- Scene orientation tools can be used for orienting object to bundles.
- All tools which works with list of tracks or reconstruction data now
gets that lists from active editing object.
- All objects and their tracking data are available via python api.
Diffstat (limited to 'source/blender/editors/space_clip/clip_graph_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_ops.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index 56ca1632bae..08d6bcf47bc 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -155,13 +155,14 @@ static int mouse_select_knot(bContext *C, float co[2], int extend) ARegion *ar= CTX_wm_region(C); View2D *v2d= &ar->v2d; MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking); static const int delta= 6; - if(tracking->act_track) { + if(act_track) { MouseSelectUserData userdata; mouse_select_init_data(&userdata, co); - clip_graph_tracking_values_iterate_track(sc, tracking->act_track, + clip_graph_tracking_values_iterate_track(sc, act_track, &userdata, find_nearest_tracking_knot_cb, NULL, NULL); if(userdata.marker) { @@ -191,6 +192,7 @@ static int mouse_select_curve(bContext *C, float co[2], int extend) SpaceClip *sc= CTX_wm_space_clip(C); MovieClip *clip= ED_space_clip(sc); MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking); MouseSelectUserData userdata; mouse_select_init_data(&userdata, co); @@ -198,12 +200,12 @@ static int mouse_select_curve(bContext *C, float co[2], int extend) if(userdata.track) { if(extend) { - if(tracking->act_track==userdata.track) { + if(act_track==userdata.track) { /* currently only single curve can be selected (selected curve represents active track) */ - tracking->act_track= NULL; + act_track= NULL; } } - else if(tracking->act_track!=userdata.track) { + else if(act_track!=userdata.track) { MovieTrackingMarker *marker; SelectUserData selectdata = {SEL_DESELECT}; @@ -292,9 +294,11 @@ static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op)) SpaceClip *sc= CTX_wm_space_clip(C); MovieClip *clip= ED_space_clip(sc); MovieTracking *tracking= &clip->tracking; + ListBase *tracksbase= BKE_tracking_get_tracks(tracking); + MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking); - if(tracking->act_track) - clip_delete_track(C, clip, tracking->act_track); + if(act_track) + clip_delete_track(C, clip, tracksbase, act_track); return OPERATOR_FINISHED; } @@ -322,16 +326,17 @@ static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op)) SpaceClip *sc= CTX_wm_space_clip(C); MovieClip *clip= ED_space_clip(sc); MovieTracking *tracking= &clip->tracking; + ListBase *tracksbase= BKE_tracking_get_tracks(tracking); + MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking); - if(tracking->act_track) { + if(act_track) { int a= 0; - MovieTrackingTrack *track= tracking->act_track; - while(a<track->markersnr) { - MovieTrackingMarker *marker= &track->markers[a]; + while(a<act_track->markersnr) { + MovieTrackingMarker *marker= &act_track->markers[a]; if(marker->flag&MARKER_GRAPH_SEL) - clip_delete_marker(C, clip, track, marker); + clip_delete_marker(C, clip, tracksbase, act_track, marker); else a++; } |