Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-04-30 00:04:12 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-04-30 00:04:12 +0400
commitebe4ffa8de3c0a2d471e6f859e96921fe95b475b (patch)
tree4faba21ba91585bb906c86655d1eacbdfda970b2 /source/blender/editors/space_clip/clip_dopesheet_ops.c
parentebbc038e4f044be9f2c5f495bce685fb267d99cf (diff)
Tomato: refactoring of dopesheet to allow different sort orders in list of channels
Store list of channels displaying in dopesheet separately from list of tracks. This allows to re-sort channels in dopesheet independently from list of all tracks (currently only alphabetic sorting is implemented). This also allows to cache assorted information (like tracked segments of track) but currently such a things are not bottlenecks and could be done after merge dopesheet view into trunk. TODO: - Still have some deadlocks when drawing selected channels. Skipping channel background or keyframe drawing helps here but this need to be resolved. - Bump sub-version and wrote code needed to convert pre-dopesheet interface with opened curve view displaying properly. - Probably it'll worth caching tracked segments.
Diffstat (limited to 'source/blender/editors/space_clip/clip_dopesheet_ops.c')
-rw-r--r--source/blender/editors/space_clip/clip_dopesheet_ops.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/source/blender/editors/space_clip/clip_dopesheet_ops.c b/source/blender/editors/space_clip/clip_dopesheet_ops.c
index 2225f01afe3..bec030f5e21 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_ops.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_ops.c
@@ -91,40 +91,28 @@ static int dopesheet_select_channel_exec(bContext *C, wmOperator *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 *track;
+ MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
+ MovieTrackingDopesheetChannel *channel;
float location[2];
- int extend = RNA_boolean_get(op->ptr, "extend"), channel, channel_index;
+ int extend = RNA_boolean_get(op->ptr, "extend");
+ int current_channel_index = 0, channel_index;
RNA_float_get_array(op->ptr, "location", location);
- channel = -(location[1] - (CHANNEL_FIRST + CHANNEL_HEIGHT_HALF)) / CHANNEL_STEP;
+ channel_index = -(location[1] - (CHANNEL_FIRST + CHANNEL_HEIGHT_HALF)) / CHANNEL_STEP;
- for (track = tracksbase->first, channel_index = 0; track; track = track->next) {
- if (!TRACK_VIEW_SELECTED(sc, track))
- continue;
+ for (channel = dopesheet->channels.first; channel; channel = channel->next) {
+ MovieTrackingTrack *track = channel->track;
- if (channel_index == channel) {
+ if (current_channel_index == channel_index) {
if (extend)
track->flag ^= TRACK_DOPE_SEL;
else
track->flag |= TRACK_DOPE_SEL;
-
- if (track->flag & TRACK_DOPE_SEL) {
- MovieTrackingMarker *marker;
-
- /* make last selected in dopesheet track active in clip editor */
- tracking->act_track = track;
-
- /* make active track be centered to screen */
- /* XXX: doesn't work in other opened spaces */
- marker = BKE_tracking_get_marker(track, sc->user.framenr);
- clip_view_center_to_point(sc, marker->pos[0], marker->pos[1]);
- }
}
else if (!extend)
track->flag &= ~TRACK_DOPE_SEL;
- channel_index++;
+ current_channel_index++;
}
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);