Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_ops.c
| Show First 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | |||||
| #endif /* USE_LOOPSLIDE_HACK */ | #endif /* USE_LOOPSLIDE_HACK */ | ||||
| static void transformops_exit(bContext *C, wmOperator *op) | static void transformops_exit(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| #ifdef USE_LOOPSLIDE_HACK | #ifdef USE_LOOPSLIDE_HACK | ||||
| transformops_loopsel_hack(C, op); | transformops_loopsel_hack(C, op); | ||||
| #endif | #endif | ||||
| TransInfo *t = op->customdata; | |||||
| saveTransform(C, t, op); | |||||
| saveTransform(C, op->customdata, op); | if (t->gz && t->gz->type == WM_gizmotype_find("GIZMO_GT_dial_3d", true)) { | ||||
| MEM_freeN(op->customdata); | WM_gizmo_target_property_clear_rna(t->gz, "offset"); | ||||
| } | |||||
| MEM_freeN(t); | |||||
| op->customdata = NULL; | op->customdata = NULL; | ||||
| G.moving = 0; | G.moving = 0; | ||||
| } | } | ||||
| static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event) | static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| { | { | ||||
| int retval = 1; | int retval = 1; | ||||
| if (op->customdata == NULL) { | if (op->customdata == NULL) { | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | if (mode_prev != t->mode) { | ||||
| } | } | ||||
| BLI_assert(ot_new != NULL); | BLI_assert(ot_new != NULL); | ||||
| if (ot_new) { | if (ot_new) { | ||||
| WM_operator_type_set(op, ot_new); | WM_operator_type_set(op, ot_new); | ||||
| } | } | ||||
| /* end suspicious code */ | /* end suspicious code */ | ||||
| } | } | ||||
| if (t->gz && t->gz->type == WM_gizmotype_find("GIZMO_GT_dial_3d", true)) { | |||||
| /* Set the 'value' property during the modal to be used in the gizmo drawing. */ | |||||
| float value = (t->flag & T_AUTOVALUES) ? t->auto_values[0] : t->values[0]; | |||||
| RNA_float_set(op->ptr, "value", value); | |||||
| } | |||||
| } | } | ||||
| return exit_code; | return exit_code; | ||||
| } | } | ||||
| static void transform_cancel(bContext *C, wmOperator *op) | static void transform_cancel(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| TransInfo *t = op->customdata; | TransInfo *t = op->customdata; | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | else { | ||||
| op->flag |= OP_IS_MODAL_GRAB_CURSOR; // XXX maybe we want this with the gizmo only? | op->flag |= OP_IS_MODAL_GRAB_CURSOR; // XXX maybe we want this with the gizmo only? | ||||
| /* Use when modal input has some transformation to begin with. */ | /* Use when modal input has some transformation to begin with. */ | ||||
| { | { | ||||
| TransInfo *t = op->customdata; | TransInfo *t = op->customdata; | ||||
| if (UNLIKELY(!is_zero_v4(t->values_modal_offset))) { | if (UNLIKELY(!is_zero_v4(t->values_modal_offset))) { | ||||
| transformApply(C, t); | transformApply(C, t); | ||||
| } | } | ||||
| if (t->gz && t->gz->type == WM_gizmotype_find("GIZMO_GT_dial_3d", true)) { | |||||
| /* Set the property for the gizmo to use in its draw function. */ | |||||
| WM_gizmo_target_property_def_rna(t->gz, "offset", op->ptr, "value", -1); | |||||
| } | |||||
| } | } | ||||
| return OPERATOR_RUNNING_MODAL; | return OPERATOR_RUNNING_MODAL; | ||||
| } | } | ||||
| } | } | ||||
| static bool transform_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop) | static bool transform_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 781 Lines • Show Last 20 Lines | |||||