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/space_view3d/view3d_navigate_roll.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate_roll.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate_roll.c b/source/blender/editors/space_view3d/view3d_navigate_roll.c
index 4675aad9af5..c9bfdc4412a 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_roll.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_roll.c
@@ -107,7 +107,8 @@ static int viewroll_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* Note this does not remove auto-keys on locked cameras. */
copy_qt_qt(vod->rv3d->viewquat, vod->init.quat);
ED_view3d_camera_lock_sync(vod->depsgraph, vod->v3d, vod->rv3d);
- viewops_data_free(C, op);
+ viewops_data_free(C, op->customdata);
+ op->customdata = NULL;
return OPERATOR_CANCELLED;
}
else if (event->type == vod->init.event_type && event->val == KM_RELEASE) {
@@ -130,7 +131,8 @@ static int viewroll_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
if (ret & OPERATOR_FINISHED) {
- viewops_data_free(C, op);
+ viewops_data_free(C, op->customdata);
+ op->customdata = NULL;
}
return ret;
@@ -201,11 +203,13 @@ static int viewroll_exec(bContext *C, wmOperator *op)
.dyn_ofs = dyn_ofs_pt,
});
- viewops_data_free(C, op);
+ viewops_data_free(C, op->customdata);
+ op->customdata = NULL;
return OPERATOR_FINISHED;
}
- viewops_data_free(C, op);
+ viewops_data_free(C, op->customdata);
+ op->customdata = NULL;
return OPERATOR_CANCELLED;
}
@@ -220,8 +224,7 @@ static int viewroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
}
else {
/* makes op->customdata */
- viewops_data_create(C, op, event, viewops_flag_from_prefs());
- vod = op->customdata;
+ vod = op->customdata = viewops_data_create(C, event, viewops_flag_from_prefs());
vod->init.dial = BLI_dial_init((const float[2]){BLI_rcti_cent_x(&vod->region->winrct),
BLI_rcti_cent_y(&vod->region->winrct)},
FLT_EPSILON);
@@ -236,7 +239,8 @@ static int viewroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
vod->init.event_xy[0] = vod->prev.event_xy[0] = event->xy[0];
viewroll_apply(vod, event->prev_xy[0], event->prev_xy[1]);
- viewops_data_free(C, op);
+ viewops_data_free(C, op->customdata);
+ op->customdata = NULL;
return OPERATOR_FINISHED;
}
@@ -249,7 +253,8 @@ static int viewroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void viewroll_cancel(bContext *C, wmOperator *op)
{
- viewops_data_free(C, op);
+ viewops_data_free(C, op->customdata);
+ op->customdata = NULL;
}
void VIEW3D_OT_view_roll(wmOperatorType *ot)