Fix T98141: Strip rotation is limited to +/360 degrees

This limiting prevented visual keyframing from working correctly and is
not consistent with object rotation, so limiting is removed.
This commit is contained in:
Richard Antalik 2022-05-23 23:28:21 +02:00
parent 8eda776eef
commit c968dae054
Notes: blender-bot 2023-12-08 16:39:08 +01:00
Referenced by issue #98141,  Rotation value on preview sequencer view  and the value in sidebar don't match
Referenced by issue #96589, Image rotation in Vide Editor goes to 360 rather than negative numbers
1 changed files with 8 additions and 9 deletions

View File

@ -197,11 +197,7 @@ void recalcData_sequencer_image(TransInfo *t)
/* Rotation. Scaling can cause negative rotation. */
if (t->mode == TFM_ROTATION) {
const float orig_dir[2] = {cosf(tdseq->orig_rotation), sinf(tdseq->orig_rotation)};
float rotation = angle_signed_v2v2(handle_x, orig_dir) * mirror[0] * mirror[1];
transform->rotation = tdseq->orig_rotation + rotation;
transform->rotation += DEG2RAD(360.0);
transform->rotation = fmod(transform->rotation, DEG2RAD(360.0));
transform->rotation = tdseq->orig_rotation - t->values_final[0];
}
SEQ_relations_invalidate_cache_preprocessed(t->scene, seq);
}
@ -209,9 +205,6 @@ void recalcData_sequencer_image(TransInfo *t)
void special_aftertrans_update__sequencer_image(bContext *UNUSED(C), TransInfo *t)
{
if (t->state == TRANS_CANCEL) {
return;
}
TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t);
TransData *td = NULL;
@ -225,8 +218,14 @@ void special_aftertrans_update__sequencer_image(bContext *UNUSED(C), TransInfo *
TransDataSeq *tdseq = td->extra;
Sequence *seq = tdseq->seq;
StripTransform *transform = seq->strip->transform;
Scene *scene = t->scene;
if (t->state == TRANS_CANCEL) {
if (t->mode == TFM_ROTATION) {
transform->rotation = tdseq->orig_rotation;
}
continue;
}
Scene *scene = t->scene;
RNA_pointer_create(&scene->id, &RNA_SequenceTransform, transform, &ptr);
if (t->mode == TFM_ROTATION) {