diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_select.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 23 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 15 |
5 files changed, 52 insertions, 3 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index e31aebf0155..7b9f2faf08a 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -366,13 +366,21 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View /* for now, just init the string with fixed-formats */ switch (strip->type) { case NLASTRIP_TYPE_TRANSITION: /* Transition */ - sprintf(str, "%d | Transition | %.2f %s %.2f", index, strip->start, dir, strip->end); + sprintf(str, "%d | Transition | %.2f %s %.2f", + index, strip->start, dir, strip->end); + break; + + case NLASTRIP_TYPE_META: /* Meta */ + sprintf(str, "%d | %sMeta | %.2f %s %.2f", + index, ((strip->flag & NLASTRIP_FLAG_TEMP_META)?"Temp-":""), + strip->start, dir, strip->end); break; case NLASTRIP_TYPE_CLIP: /* Action-Clip (default) */ default: if (strip->act) - sprintf(str, "%d | Act: %s | %.2f %s %.2f", index, strip->act->id.name+2, strip->start, dir, strip->end); + sprintf(str, "%d | Act: %s | %.2f %s %.2f", + index, strip->act->id.name+2, strip->start, dir, strip->end); else sprintf(str, "%d | Act: <NONE>", index); // xxx... need a better format? break; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 676d0aac1b1..d663b76d5fe 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1264,6 +1264,9 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op) /* need to add a new track above the current one */ track= add_nlatrack(adt, nlt); BKE_nlatrack_add_strip(track, strip); + + /* clear temp meta-strips on this new track, as we may not be able to get back to it */ + BKE_nlastrips_clear_metas(&track->strips, 0, 1); } } diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index c238818dd1e..ca186dcf702 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -513,7 +513,7 @@ static void nlaedit_mselect_leftright (bContext *C, bAnimContext *ac, short left /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* select strips on the side where most data occurs */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index b2afaac23de..758be545fd0 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2617,6 +2617,9 @@ static void createTransNlaData(bContext *C, TransInfo *t) NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; + /* make some meta-strips for chains of selected strips */ + BKE_nlastrips_make_metas(&nlt->strips, 1); + /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... @@ -4754,6 +4757,26 @@ void special_aftertrans_update(TransInfo *t) if (ANIM_animdata_context_getdata(&ac) == 0) return; + if (ac.datatype) + { + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NLATRACKS); + + /* get channels to work on */ + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + + /* remove the temp metas */ + BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); + } + + /* free temp memory */ + BLI_freelistN(&anim_data); + } + // XXX check on the calls below... we need some of these sanity checks //synchronize_action_strips(); //ANIM_editkeyframes_refresh(&ac); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 1474a30fbed..e228dc2b13a 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -82,6 +82,7 @@ #include "BKE_key.h" #include "BKE_mesh.h" #include "BKE_modifier.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_utildefines.h" #include "BKE_context.h" @@ -388,6 +389,20 @@ void recalcData(TransInfo *t) } } } + + /* loop over the TransDataNla again, flushing the transforms (since we use Metas to make transforms easier) */ + td= t->data; + for (i = 0; i < t->total; i++, td++) + { + if (td->extra) + { + TransDataNla *tdn= td->extra; + NlaStrip *strip= tdn->strip; + + // TODO: this may flush some things twice, but that's fine as there's no impact from that + BKE_nlameta_flush_transforms(strip); + } + } } else if (t->obedit) { if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { |