From d04d27b406b856396102452cab0eedf315e94a54 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 Oct 2021 12:32:04 +1100 Subject: Sequencer: 2D cursor for the preview & transform - Use 2D cursor in the preview space using shortcuts matching the UV editor and 3D view. - Add Cursor tool, cursor transform. - Support for cursor and bound-box pivot. - Add pivot pie menu. --- source/blender/editors/transform/transform_generics.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/transform/transform_generics.c') diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index fa323f0c1f7..09c338046ed 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -46,6 +46,8 @@ #include "BKE_modifier.h" #include "BKE_paint.h" +#include "SEQ_transform.h" + #include "ED_clip.h" #include "ED_image.h" #include "ED_object.h" @@ -885,12 +887,18 @@ void calculateCenterCursor(TransInfo *t, float r_center[3]) void calculateCenterCursor2D(TransInfo *t, float r_center[2]) { + float cursor_local_buf[2]; const float *cursor = NULL; if (t->spacetype == SPACE_IMAGE) { SpaceImage *sima = (SpaceImage *)t->area->spacedata.first; cursor = sima->cursor; } + if (t->spacetype == SPACE_SEQ) { + SpaceSeq *sseq = (SpaceSeq *)t->area->spacedata.first; + SEQ_image_preview_unit_to_px(t->scene, sseq->cursor, cursor_local_buf); + cursor = cursor_local_buf; + } else if (t->spacetype == SPACE_CLIP) { SpaceClip *space_clip = (SpaceClip *)t->area->spacedata.first; cursor = space_clip->cursor; @@ -1069,7 +1077,7 @@ static void calculateCenter_FromAround(TransInfo *t, int around, float r_center[ calculateCenterMedian(t, r_center); break; case V3D_AROUND_CURSOR: - if (ELEM(t->spacetype, SPACE_IMAGE, SPACE_CLIP)) { + if (ELEM(t->spacetype, SPACE_IMAGE, SPACE_SEQ, SPACE_CLIP)) { calculateCenterCursor2D(t, r_center); } else if (t->spacetype == SPACE_GRAPH) { -- cgit v1.2.3