Commit: 93867cfafcf5474c565505f4f54e89e1cda6c99f
Author: Campbell Barton
Date:   Tue Jan 15 18:54:43 2019 +1100
Branches: master
https://developer.blender.org/rB93867cfafcf5474c565505f4f54e89e1cda6c99f

Correct last commit

===================================================================

M       source/blender/editors/transform/transform.c
M       source/blender/editors/transform/transform_input.c

===================================================================

diff --git a/source/blender/editors/transform/transform.c 
b/source/blender/editors/transform/transform.c
index c42e350fd5f..53943eb830e 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2600,18 +2600,11 @@ bool initTransform(bContext *C, TransInfo *t, 
wmOperator *op, const wmEvent *eve
                        setUserConstraint(t, t->orientation.user, t->con.mode, 
"%s");
                }
        }
-       /* Apply values_modal_offset (after we have constraints). */
+
+       /* Don't write into the values when non-modal because they are already 
set from operator redo values. */
        if (t->flag & T_MODAL) {
-               if (!is_zero_v3(t->values_modal_offset)) {
-                       float values_ofs[3];
-                       if (t->con.mode & CON_APPLY) {
-                               mul_v3_m3v3(values_ofs, t->spacemtx, 
t->values_modal_offset);
-                       }
-                       else {
-                               copy_v3_v3(values_ofs, t->values_modal_offset);
-                       }
-                       add_v3_v3(t->values, values_ofs);
-               }
+               /* Setup the mouse input with initial values. */
+               applyMouseInput(t, &t->mouse, t->mouse.imval, t->values);
        }
 
        if ((prop = RNA_struct_find_property(op->ptr, "preserve_clnor"))) {
diff --git a/source/blender/editors/transform/transform_input.c 
b/source/blender/editors/transform/transform_input.c
index 20c442d5881..190bc57fcfd 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -387,12 +387,6 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, 
MouseInputMode mode)
        if (mi_data_prev && (mi_data_prev != mi->data)) {
                MEM_freeN(mi_data_prev);
        }
-
-       /* Don't write into the values when non-modal because they are already 
set from operator redo values. */
-       if (t->flag & T_MODAL) {
-               /* bootstrap mouse input with initial values */
-               applyMouseInput(t, mi, mi->imval, t->values);
-       }
 }
 
 void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float 
values[3]))
@@ -435,6 +429,17 @@ void applyMouseInput(TransInfo *t, MouseInput *mi, const 
int mval[2], float outp
                mi->apply(t, mi, mval_db, output);
        }
 
+       if (!is_zero_v3(t->values_modal_offset)) {
+               float values_ofs[3];
+               if (t->con.mode & CON_APPLY) {
+                       mul_v3_m3v3(values_ofs, t->spacemtx, 
t->values_modal_offset);
+               }
+               else {
+                       copy_v3_v3(values_ofs, t->values_modal_offset);
+               }
+               add_v3_v3(t->values, values_ofs);
+       }
+
        if (mi->post) {
                mi->post(t, output);
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to