diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-24 19:15:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-24 19:15:01 +0400 |
commit | 9697493c77d93fff9fd739d617c46f5a09ea49a6 (patch) | |
tree | 92eb5674597ca8b1aca9ec46fe7542448175c05f /source | |
parent | f3518d9d767e8f648563eab58f51863105a547d6 (diff) |
allow to scale and rotate from edge/vertex slide.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform.c | 19 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.h | 1 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 13 |
3 files changed, 23 insertions, 10 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1b80aa3fb59..0e29ba51780 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -908,12 +908,7 @@ int transformEvent(TransInfo *t, const wmEvent *event) case TFM_MODAL_TRANSLATE: /* only switch when... */ if (ELEM5(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) { - if (t->mode == TFM_EDGE_SLIDE) { - freeEdgeSlideVerts(t); - } - else if (t->mode == TFM_VERT_SLIDE) { - freeVertSlideVerts(t); - } + resetTransModal(t); resetTransRestrictions(t); restoreTransObjects(t); initTranslation(t); @@ -928,6 +923,7 @@ int transformEvent(TransInfo *t, const wmEvent *event) else { if (t->obedit && t->obedit->type == OB_MESH) { if ((t->mode == TFM_TRANSLATION) && (t->spacetype == SPACE_VIEW3D)) { + resetTransModal(t); resetTransRestrictions(t); restoreTransObjects(t); @@ -963,8 +959,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) case TFM_MODAL_ROTATE: /* only switch when... */ if (!(t->options & CTX_TEXTURE) && !(t->options & (CTX_MOVIECLIP | CTX_MASK))) { - if (ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) { - + if (ELEM6(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) { + resetTransModal(t); resetTransRestrictions(t); if (t->mode == TFM_ROTATION) { @@ -982,7 +978,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) break; case TFM_MODAL_RESIZE: /* only switch when... */ - if (ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) { + if (ELEM5(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL, TFM_EDGE_SLIDE, TFM_VERT_SLIDE)) { + resetTransModal(t); resetTransRestrictions(t); restoreTransObjects(t); initResize(t); @@ -1227,6 +1224,7 @@ int transformEvent(TransInfo *t, const wmEvent *event) case GKEY: /* only switch when... */ if (ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) { + resetTransModal(t); resetTransRestrictions(t); restoreTransObjects(t); initTranslation(t); @@ -1237,6 +1235,7 @@ int transformEvent(TransInfo *t, const wmEvent *event) case SKEY: /* only switch when... */ if (ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) { + resetTransModal(t); resetTransRestrictions(t); restoreTransObjects(t); initResize(t); @@ -1248,7 +1247,7 @@ int transformEvent(TransInfo *t, const wmEvent *event) /* only switch when... */ if (!(t->options & CTX_TEXTURE)) { if (ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) { - + resetTransModal(t); resetTransRestrictions(t); if (t->mode == TFM_ROTATION) { diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 20d5ddd6704..ed9657b0586 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -697,6 +697,7 @@ void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float val int initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, const struct wmEvent *event); void postTrans(struct bContext *C, TransInfo *t); +void resetTransModal(TransInfo *t); void resetTransRestrictions(TransInfo *t); void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis, short options); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index be82a4e0660..a32a6b031b8 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1002,6 +1002,19 @@ void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis } } +/** + * Free data before switching to another mode. + */ +void resetTransModal(TransInfo *t) +{ + if (t->mode == TFM_EDGE_SLIDE) { + freeEdgeSlideVerts(t); + } + else if (t->mode == TFM_VERT_SLIDE) { + freeVertSlideVerts(t); + } +} + void resetTransRestrictions(TransInfo *t) { t->flag &= ~T_ALL_RESTRICTIONS; |