Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_sequencer_image.c
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | |||||
| static void freeSeqData(TransInfo *UNUSED(t), | static void freeSeqData(TransInfo *UNUSED(t), | ||||
| TransDataContainer *tc, | TransDataContainer *tc, | ||||
| TransCustomData *UNUSED(custom_data)) | TransCustomData *UNUSED(custom_data)) | ||||
| { | { | ||||
| TransData *td = (TransData *)tc->data; | TransData *td = (TransData *)tc->data; | ||||
| MEM_freeN(td->extra); | MEM_freeN(td->extra); | ||||
| } | } | ||||
| void createTransSeqImageData(TransInfo *t) | static void createTransSeqImageData(bContext *UNUSED(C), TransInfo *t) | ||||
| { | { | ||||
| Editing *ed = SEQ_editing_get(t->scene); | Editing *ed = SEQ_editing_get(t->scene); | ||||
| const SpaceSeq *sseq = t->area->spacedata.first; | const SpaceSeq *sseq = t->area->spacedata.first; | ||||
| const ARegion *region = t->region; | const ARegion *region = t->region; | ||||
| if (ed == NULL) { | if (ed == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | if (do_scale) { | ||||
| changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false); | changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false); | ||||
| prop = RNA_struct_find_property(&ptr, "scale_y"); | prop = RNA_struct_find_property(&ptr, "scale_y"); | ||||
| changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false); | changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false); | ||||
| } | } | ||||
| return changed; | return changed; | ||||
| } | } | ||||
| void recalcData_sequencer_image(TransInfo *t) | static void recalcData_sequencer_image(TransInfo *t) | ||||
| { | { | ||||
| TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | ||||
| TransData *td = NULL; | TransData *td = NULL; | ||||
| TransData2D *td2d = NULL; | TransData2D *td2d = NULL; | ||||
| int i; | int i; | ||||
| for (i = 0, td = tc->data, td2d = tc->data_2d; i < tc->data_len; i++, td++, td2d++) { | for (i = 0, td = tc->data, td2d = tc->data_2d; i < tc->data_len; i++, td++, td2d++) { | ||||
| /* Origin. */ | /* Origin. */ | ||||
| Show All 39 Lines | if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) { | ||||
| animrecord_check_state(t, &t->scene->id); | animrecord_check_state(t, &t->scene->id); | ||||
| autokeyframe_sequencer_image(t->context, t->scene, transform, t->mode); | autokeyframe_sequencer_image(t->context, t->scene, transform, t->mode); | ||||
| } | } | ||||
| SEQ_relations_invalidate_cache_preprocessed(t->scene, seq); | SEQ_relations_invalidate_cache_preprocessed(t->scene, seq); | ||||
| } | } | ||||
| } | } | ||||
| void special_aftertrans_update__sequencer_image(bContext *UNUSED(C), TransInfo *t) | static void special_aftertrans_update__sequencer_image(bContext *UNUSED(C), TransInfo *t) | ||||
| { | { | ||||
| TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | ||||
| TransData *td = NULL; | TransData *td = NULL; | ||||
| TransData2D *td2d = NULL; | TransData2D *td2d = NULL; | ||||
| int i; | int i; | ||||
| for (i = 0, td = tc->data, td2d = tc->data_2d; i < tc->data_len; i++, td++, td2d++) { | for (i = 0, td = tc->data, td2d = tc->data_2d; i < tc->data_len; i++, td++, td2d++) { | ||||
| TransDataSeq *tdseq = td->extra; | TransDataSeq *tdseq = td->extra; | ||||
| Sequence *seq = tdseq->seq; | Sequence *seq = tdseq->seq; | ||||
| StripTransform *transform = seq->strip->transform; | StripTransform *transform = seq->strip->transform; | ||||
| if (t->state == TRANS_CANCEL) { | if (t->state == TRANS_CANCEL) { | ||||
| if (t->mode == TFM_ROTATION) { | if (t->mode == TFM_ROTATION) { | ||||
| transform->rotation = tdseq->orig_rotation; | transform->rotation = tdseq->orig_rotation; | ||||
| } | } | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (IS_AUTOKEY_ON(t->scene)) { | if (IS_AUTOKEY_ON(t->scene)) { | ||||
| autokeyframe_sequencer_image(t->context, t->scene, transform, t->mode); | autokeyframe_sequencer_image(t->context, t->scene, transform, t->mode); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| TransConvertTypeInfo TransConvertType_SequencerImage = { | |||||
| /* flags */ (T_POINTS | T_2D_EDIT), | |||||
| /* createTransData */ createTransSeqImageData, | |||||
| /* recalcData */ recalcData_sequencer_image, | |||||
| /* special_aftertrans_update */ special_aftertrans_update__sequencer_image, | |||||
| }; | |||||