Fix T93570: VSE image transforms in preview dont autokey
This was basically not implemented, do this via `ED_autokeyframe_property` in a new dedicated function in special_aftertrans_update. Maniphest Tasks: T93570 Differential Revision: https://developer.blender.org/D13608
This commit is contained in:
parent
fdb2167b4a
commit
ffd1a7d8c8
Notes:
blender-bot
2023-02-14 06:55:40 +01:00
Referenced by issue #98435, VSE autokeying transforms in preview dont respect keyingsets Referenced by issue #98429, VSE autokeying transforms in preview only creates keyframes for rotation/scale if rotating/scaling around cursor (should keyframe position as well) Referenced by issue #98430, VSE autokeying transforms in preview only creates keyframes if there is an FCurve already Referenced by issue #98431, VSE autokeying transforms in preview does not work during animation playback Referenced by issue #98015, VSE strip transforms do not animate correctly and persist after clearing the animation Referenced by issue #93570, Transforming a sequencer strip with gizmos doesn't autokey its transform properties
|
@ -914,6 +914,9 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
|
|||
case TC_SEQ_DATA:
|
||||
special_aftertrans_update__sequencer(C, t);
|
||||
break;
|
||||
case TC_SEQ_IMAGE_DATA:
|
||||
special_aftertrans_update__sequencer_image(C, t);
|
||||
break;
|
||||
case TC_TRACKING_DATA:
|
||||
special_aftertrans_update__movieclip(C, t);
|
||||
break;
|
||||
|
@ -930,7 +933,6 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
|
|||
case TC_OBJECT_TEXSPACE:
|
||||
case TC_PAINT_CURVE_VERTS:
|
||||
case TC_PARTICLE_VERTS:
|
||||
case TC_SEQ_IMAGE_DATA:
|
||||
case TC_NONE:
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -304,6 +304,7 @@ void special_aftertrans_update__sequencer(bContext *C, TransInfo *t);
|
|||
/* transform_convert_sequencer_image.c */
|
||||
void createTransSeqImageData(TransInfo *t);
|
||||
void recalcData_sequencer_image(TransInfo *t);
|
||||
void special_aftertrans_update__sequencer_image(bContext *C, TransInfo *t);
|
||||
|
||||
/* transform_convert_tracking.c */
|
||||
void createTransTrackingData(bContext *C, TransInfo *t);
|
||||
|
|
|
@ -38,8 +38,12 @@
|
|||
#include "SEQ_transform.h"
|
||||
#include "SEQ_utils.h"
|
||||
|
||||
#include "ED_keyframing.h"
|
||||
|
||||
#include "UI_view2d.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
|
||||
#include "transform.h"
|
||||
#include "transform_convert.h"
|
||||
|
||||
|
@ -215,3 +219,44 @@ void recalcData_sequencer_image(TransInfo *t)
|
|||
SEQ_relations_invalidate_cache_preprocessed(t->scene, seq);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
TransData2D *td2d = NULL;
|
||||
int i;
|
||||
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
for (i = 0, td = tc->data, td2d = tc->data_2d; i < tc->data_len; i++, td++, td2d++) {
|
||||
TransDataSeq *tdseq = td->extra;
|
||||
Sequence *seq = tdseq->seq;
|
||||
StripTransform *transform = seq->strip->transform;
|
||||
Scene *scene = t->scene;
|
||||
|
||||
RNA_pointer_create(&scene->id, &RNA_SequenceTransform, transform, &ptr);
|
||||
|
||||
if (t->mode == TFM_ROTATION) {
|
||||
prop = RNA_struct_find_property(&ptr, "rotation");
|
||||
ED_autokeyframe_property(t->context, scene, &ptr, prop, -1, CFRA);
|
||||
}
|
||||
if (t->mode == TFM_TRANSLATION) {
|
||||
prop = RNA_struct_find_property(&ptr, "offset_x");
|
||||
ED_autokeyframe_property(t->context, scene, &ptr, prop, -1, CFRA);
|
||||
prop = RNA_struct_find_property(&ptr, "offset_y");
|
||||
ED_autokeyframe_property(t->context, scene, &ptr, prop, -1, CFRA);
|
||||
}
|
||||
if (t->mode == TFM_RESIZE) {
|
||||
prop = RNA_struct_find_property(&ptr, "scale_x");
|
||||
ED_autokeyframe_property(t->context, scene, &ptr, prop, -1, CFRA);
|
||||
prop = RNA_struct_find_property(&ptr, "scale_y");
|
||||
ED_autokeyframe_property(t->context, scene, &ptr, prop, -1, CFRA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue