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:
authorGermano Cavalcante <germano.costa@ig.com.br>2022-02-05 01:34:56 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-02-05 02:38:53 +0300
commitb1b1a74af15b4eaa0757ad88acfbcac73b9a64fe (patch)
tree0132cce785cc9305f8ea1dacf13fd453ede8f450 /source/blender/editors/space_view3d/view3d_navigate_roll.c
parentec9f237a9ef01e5966228e0789eeecc419021f56 (diff)
Cleanup: set 'op->customdata' out of 'viewops_data_create'
Setting the `op->customdata` out of `viewops_data_create` makes the usage of the function clearer thus making the code easier to read.
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)