diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-15 07:35:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-15 07:35:31 +0400 |
commit | 2e154f7ce5debda643638815f30482a286a19c3d (patch) | |
tree | 666df0286159e743c7594e932e9861b59ca4432e /source/blender/editors/transform | |
parent | 819a75113e33c42a3b5fd66d67862512e22a0fe6 (diff) |
vertex slide was using flipped value, wasnt so noticable unless you types in a value.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 28 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.h | 10 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_input.c | 4 |
3 files changed, 22 insertions, 20 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 2afc1168cbd..da40f01592c 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -5839,13 +5839,22 @@ static void calcVertSlideCustomPoints(struct TransInfo *t) { VertSlideData *sld = t->customData; TransDataVertSlideVert *sv = &sld->sv[sld->curr_sv_index]; - int start[2] = {UNPACK2(sv->co_orig_2d)}; - int end[2] = {UNPACK2(sv->co_link_orig_2d[sv->co_link_curr])}; - if (sld->flipped_vtx) { - setCustomPoints(t, &t->mouse, start, end); - } - else { - setCustomPoints(t, &t->mouse, end, start); + float *co_orig = sv->co_orig_2d; + float *co_curr = sv->co_link_orig_2d[sv->co_link_curr]; + float co_curr_flip[2]; + + sub_v2_v2v2(co_curr_flip, co_curr, co_orig); + sub_v2_v2v2(co_curr_flip, co_orig, co_curr_flip); + + { + const int start[2] = {co_orig[0], co_orig[1]}; + const int end[2] = {co_curr_flip[0], co_curr_flip[1]}; + if (!sld->flipped_vtx) { + setCustomPoints(t, &t->mouse, end, start); + } + else { + setCustomPoints(t, &t->mouse, start, end); + } } } static void calcVertSlideMouseMove(struct TransInfo *t, const int mval[2], const bool is_init) @@ -6200,15 +6209,14 @@ static int doVertSlide(TransInfo *t, float perc) sv = svlist; if (sld->is_proportional == TRUE) { - const float tperc = perc + 1.0f; for (i = 0; i < sld->totsv; i++, sv++) { - interp_v3_v3v3(sv->v->co, sv->co_link_orig_3d[sv->co_link_curr], sv->co_orig_3d, tperc); + interp_v3_v3v3(sv->v->co, sv->co_orig_3d, sv->co_link_orig_3d[sv->co_link_curr], perc); } } else { TransDataVertSlideVert *sv_curr = &sld->sv[sld->curr_sv_index]; const float edge_len_curr = len_v3v3(sv_curr->co_orig_3d, sv_curr->co_link_orig_3d[sv_curr->co_link_curr]); - const float tperc = -perc * edge_len_curr; + const float tperc = perc * edge_len_curr; for (i = 0; i < sld->totsv; i++, sv++) { float edge_len; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 4eff920f8e8..4d88f3d8b36 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -52,12 +52,7 @@ struct Object; struct View3D; struct ScrArea; struct Scene; -struct bPose; struct bConstraint; -struct BezTriple; -struct wmOperatorType; -struct wmOperator; -struct wmWindowManager; struct wmKeyMap; struct wmKeyConfig; struct bContext; @@ -65,7 +60,6 @@ struct wmEvent; struct wmTimer; struct ARegion; struct ReportList; -struct SmallHash; typedef struct TransSnapPoint { struct TransSnapPoint *next, *prev; @@ -685,12 +679,12 @@ typedef enum { INPUT_CUSTOM_RATIO } MouseInputMode; -void initMouseInput(TransInfo *t, MouseInput *mi, int center[2], int mval[2]); +void initMouseInput(TransInfo *t, MouseInput *mi, const int center[2], const int mval[2]); void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode); int handleMouseInput(struct TransInfo *t, struct MouseInput *mi, struct wmEvent *event); void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3]); -void setCustomPoints(TransInfo *t, MouseInput *mi, int start[2], int end[2]); +void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]); void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float values[3])); /*********************** Generics ********************************/ diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 37cd10e363c..c805dfe1b41 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -164,7 +164,7 @@ static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2 output[0] = dot_v3v3(t->viewinv[1], vec) * 2.0f; } -void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, int start[2], int end[2]) +void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, const int start[2], const int end[2]) { int *data; @@ -275,7 +275,7 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], output[0] = *angle; } -void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, int center[2], int mval[2]) +void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, const int center[2], const int mval[2]) { mi->factor = 0; mi->precision = 0; |