From 824be96dc053dbb159efbd40433dbb9a798a785d Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sat, 3 Apr 2010 17:38:43 +0000 Subject: More work on Drag Immediate: - Rename option and flag to something more sane - Add property to manipulator operator and set true by default Confirm on Release can now be forced true or false per operator, in which case it won't use the default value (the user preference). --- source/blender/editors/transform/transform_manipulator.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/editors/transform/transform_manipulator.c') diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 5e7c6fc9d3d..b11f35dd363 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1551,6 +1551,8 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float ho return 0; } +int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports); + /* return 0; nothing happened */ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) { @@ -1564,6 +1566,9 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return 0; if(!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return 0; + /* Force orientation */ + RNA_enum_set(op->ptr, "constraint_orientation", v3d->twmode); + // find the hotspots first test narrow hotspot val= manipulator_selectbuf(sa, ar, event->mval, 0.5f*(float)U.tw_hotspot); if(val) { @@ -1603,6 +1608,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_translate", WM_OP_INVOKE_DEFAULT, op->ptr); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_translate", 0), event, op->ptr, NULL); } else if (drawflags & MAN_SCALE_C) { switch(drawflags) { @@ -1633,8 +1639,10 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_resize", WM_OP_INVOKE_DEFAULT, op->ptr); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_resize", 0), event, op->ptr, NULL); } else if (drawflags == MAN_ROT_T) { /* trackball need special case, init is different */ + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, op->ptr, NULL); WM_operator_name_call(C, "TRANSFORM_OT_trackball", WM_OP_INVOKE_DEFAULT, op->ptr); } else if (drawflags & MAN_ROT_C) { @@ -1651,6 +1659,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_rotate", WM_OP_INVOKE_DEFAULT, op->ptr); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_rotate", 0), event, op->ptr, NULL); } } /* after transform, restore drawflags */ -- cgit v1.2.3