diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-06-25 16:30:49 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-06-25 16:30:49 +0400 |
commit | 6510da4ce2c7d3ffef9d95d7adedd31f59c1fc4b (patch) | |
tree | 8451f2b706d2561743d7997d9ba8748388c832f9 /source/blender/editors/transform | |
parent | deffe4a315f30a8f8a2a2e2f23f16cfcb0ac5f18 (diff) |
NLA SoC: Fix transforms for transition strips.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 68 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 16 |
2 files changed, 50 insertions, 34 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 08ce1b1d554..3bc950d5863 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2620,9 +2620,12 @@ static void createTransNlaData(bContext *C, TransInfo *t) /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... - if (strip->flag & NLASTRIP_FLAG_SELECT) { - if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++; - if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++; + /* transition strips can't get directly transformed */ + if (strip->type != NLASTRIP_TYPE_TRANSITION) { + if (strip->flag & NLASTRIP_FLAG_SELECT) { + if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++; + if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++; + } } } } @@ -2652,34 +2655,37 @@ static void createTransNlaData(bContext *C, TransInfo *t) /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... - if (strip->flag & NLASTRIP_FLAG_SELECT) { - if (FrameOnMouseSide(side, strip->start, (float)CFRA)) - { - /* init the 'extra' data for NLA strip handles first */ - tdn->strip= strip; - tdn->val= strip->start; - tdn->handle= 0; - - /* now, link the transform data up to this data */ - td->val= &tdn->val; - td->ival= tdn->val; - td->extra= tdn; - td++; - tdn++; - } - if (FrameOnMouseSide(side, strip->end, (float)CFRA)) - { - /* init the 'extra' data for NLA strip handles first */ - tdn->strip= strip; - tdn->val= strip->end; - tdn->handle= 1; - - /* now, link the transform data up to this data */ - td->val= &tdn->val; - td->ival= tdn->val; - td->extra= tdn; - td++; - tdn++; + /* transition strips can't get directly transformed */ + if (strip->type != NLASTRIP_TYPE_TRANSITION) { + if (strip->flag & NLASTRIP_FLAG_SELECT) { + if (FrameOnMouseSide(side, strip->start, (float)CFRA)) + { + /* init the 'extra' data for NLA strip handles first */ + tdn->strip= strip; + tdn->val= strip->start; + tdn->handle= 0; + + /* now, link the transform data up to this data */ + td->val= &tdn->val; + td->ival= tdn->val; + td->extra= tdn; + td++; + tdn++; + } + if (FrameOnMouseSide(side, strip->end, (float)CFRA)) + { + /* init the 'extra' data for NLA strip handles first */ + tdn->strip= strip; + tdn->val= strip->end; + tdn->handle= 1; + + /* now, link the transform data up to this data */ + td->val= &tdn->val; + td->ival= tdn->val; + td->extra= tdn; + td++; + tdn++; + } } } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index db7c6d6ee99..1474a30fbed 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -358,11 +358,21 @@ void recalcData(TransInfo *t) * ones (i.e. don't go through RNA), as we get some artifacts... */ if (t->state == TRANS_CANCEL) { - /* write the value set by the transform tools to the appropriate property using RNA */ - if (tdn->handle) + /* clear the values by directly overwriting the originals, but also need to restore + * endpoints of neighboring transition-strips + */ + if (tdn->handle) { strip->end= tdn->val; - else + + if ((strip->next) && (strip->next->type == NLASTRIP_TYPE_TRANSITION)) + strip->next->start= tdn->val; + } + else { strip->start= tdn->val; + + if ((strip->prev) && (strip->prev->type == NLASTRIP_TYPE_TRANSITION)) + strip->prev->end= tdn->val; + } } else { PointerRNA strip_ptr; |