diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-07 06:12:50 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-07 06:12:50 +0400 |
commit | 905b1380054f42fe30b19fb37861057af4760e32 (patch) | |
tree | 878b56d7ef97e56e4af8f6c46e710479441c81b0 /source/blender/editors/transform | |
parent | f98c3ed70b86d12945078c288c2bd3288a297841 (diff) |
NLA SoC: Start of integration of Meta-strips in Transform
* Chains of selected strips are now converted to meta-strips before transforms begin, and converted back afterwards. This simplifies the transform code needed in later stages...
* Transform-flushing code for Meta-Strips should now work. There seems to be a little bit of numeric inaccuracy problems somewhere, as two strips which met at the same frame can get separated when scaling.
* Meta-strips now draw with proper text identification
* Snapping strips now properly clears meta-strips if a moved strip needs to be moved into a new track to be accomodated.
* Fixed a filter used by a selection-operator.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 23 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 15 |
2 files changed, 38 insertions, 0 deletions
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) { |