Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r--source/blender/editors/transform/transform.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 7a2a2a8a5e8..960d9a25ca7 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1172,12 +1172,20 @@ int transformEvent(TransInfo *t, const wmEvent *event)
MOD_CONSTRAINT_SELECT_PLANE;
if (t->con.mode & CON_APPLY) {
stopConstraint(t);
+ initSelectConstraint(t);
+
+ /* In this case we might just want to remove the constraint,
+ * so set #TREDRAW_SOFT to only select the constraint on the next mouse move event.
+ * This way we can kind of "cancel" due to confirmation without constraint. */
+ t->redraw = TREDRAW_SOFT;
}
+ else {
+ initSelectConstraint(t);
- initSelectConstraint(t);
- /* Use #TREDRAW_SOFT so that #selectConstraint is only called on the next event.
- * This allows us to "deselect" the constraint. */
- t->redraw = TREDRAW_SOFT;
+ /* When first called, set #TREDRAW_HARD to select constraint immediately in
+ * #selectConstraint. */
+ BLI_assert(t->redraw == TREDRAW_HARD);
+ }
}
}
handled = true;
@@ -1417,9 +1425,6 @@ static void drawTransformView(const struct bContext *C, ARegion *region, void *a
/* edge slide, vert slide */
drawEdgeSlide(t);
drawVertSlide(t);
-
- /* Rotation */
- drawDial3d(t);
}
}
@@ -1571,6 +1576,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
/* do we check for parameter? */
if (transformModeUseSnap(t)) {
if (!(t->modifiers & MOD_SNAP) != !(t->tsnap.flag & SCE_SNAP)) {
+ /* Type is #eSnapFlag, but type must match various snap attributes in #ToolSettings. */
char *snap_flag_ptr;
wmMsgParams_RNA msg_key_params = {{0}};
@@ -1778,13 +1784,6 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->launch_event = event ? WM_userdef_event_type_from_keymap_type(event->type) : -1;
t->is_launch_event_drag = event ? (event->val == KM_CLICK_DRAG) : false;
- /* XXX Remove this when wm_operator_call_internal doesn't use window->eventstate
- * (which can have type = 0) */
- /* For gizmo only, so assume LEFTMOUSE. */
- if (t->launch_event == 0) {
- t->launch_event = LEFTMOUSE;
- }
-
unit_m3(t->spacemtx);
initTransInfo(C, t, op, event);
@@ -2053,3 +2052,17 @@ bool checkUseAxisMatrix(TransInfo *t)
return false;
}
+
+bool transform_apply_matrix(TransInfo *t, float mat[4][4])
+{
+ if (t->transform_matrix != NULL) {
+ t->transform_matrix(t, mat);
+ return true;
+ }
+ return false;
+}
+
+void transform_final_value_get(const TransInfo *t, float *value, const int value_num)
+{
+ memcpy(value, t->values_final, sizeof(float) * value_num);
+}