ED_transform_snap_object: remove unused bmain parameter in context creation.
This commit is contained in:
@@ -5026,7 +5026,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
const float mval[2] = {UNPACK2(event->mval)};
|
||||
|
||||
struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d(
|
||||
CTX_data_main(C), vc.scene, CTX_data_depsgraph(C), 0, vc.ar, vc.v3d);
|
||||
vc.scene, CTX_data_depsgraph(C), 0, vc.ar, vc.v3d);
|
||||
|
||||
ED_transform_snap_object_project_view3d(
|
||||
snap_context,
|
||||
|
||||
@@ -79,9 +79,9 @@ struct SnapObjectParams {
|
||||
|
||||
typedef struct SnapObjectContext SnapObjectContext;
|
||||
SnapObjectContext *ED_transform_snap_object_context_create(
|
||||
struct Main *bmain, struct Scene *scene, struct Depsgraph *depsgraph, int flag);
|
||||
struct Scene *scene, struct Depsgraph *depsgraph, int flag);
|
||||
SnapObjectContext *ED_transform_snap_object_context_create_view3d(
|
||||
struct Main *bmain, struct Scene *scene, struct Depsgraph *depsgraph, int flag,
|
||||
struct Scene *scene, struct Depsgraph *depsgraph, int flag,
|
||||
/* extra args for view3d */
|
||||
const struct ARegion *ar, const struct View3D *v3d);
|
||||
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx);
|
||||
|
||||
@@ -366,7 +366,7 @@ void EMBM_project_snap_verts(bContext *C, ARegion *ar, BMEditMesh *em)
|
||||
ED_view3d_init_mats_rv3d(obedit, ar->regiondata);
|
||||
|
||||
struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d(
|
||||
CTX_data_main(C), CTX_data_scene(C), CTX_data_depsgraph(C), 0,
|
||||
CTX_data_scene(C), CTX_data_depsgraph(C), 0,
|
||||
ar, CTX_wm_view3d(C));
|
||||
|
||||
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
|
||||
|
||||
@@ -4599,12 +4599,11 @@ void ED_view3d_cursor3d_update(bContext *C, const int mval[2])
|
||||
cursor_curr->rotation[0] *= -1.0f;
|
||||
|
||||
{
|
||||
struct Main *bmain = CTX_data_main(C);
|
||||
const float mval_fl[2] = {UNPACK2(mval)};
|
||||
float ray_no[3];
|
||||
|
||||
struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d(
|
||||
bmain, scene, CTX_data_depsgraph(C), 0, ar, v3d);
|
||||
scene, CTX_data_depsgraph(C), 0, ar, v3d);
|
||||
|
||||
float obmat[4][4];
|
||||
Object *ob_dummy = NULL;
|
||||
|
||||
@@ -278,7 +278,7 @@ static void ruler_state_set(bContext *C, RulerInfo *ruler_info, int state)
|
||||
}
|
||||
else if (state == RULER_STATE_DRAG) {
|
||||
ruler_info->snap_context = ED_transform_snap_object_context_create_view3d(
|
||||
CTX_data_main(C), CTX_data_scene(C), CTX_data_depsgraph(C), 0,
|
||||
CTX_data_scene(C), CTX_data_depsgraph(C), 0,
|
||||
ruler_info->ar, CTX_wm_view3d(C));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -282,7 +282,7 @@ static void ruler_state_set(bContext *C, RulerInfo *ruler_info, int state)
|
||||
}
|
||||
else if (state == RULER_STATE_DRAG) {
|
||||
ruler_info->snap_context = ED_transform_snap_object_context_create_view3d(
|
||||
CTX_data_main(C), CTX_data_scene(C), CTX_data_depsgraph(C), 0,
|
||||
CTX_data_scene(C), CTX_data_depsgraph(C), 0,
|
||||
ruler_info->ar, CTX_wm_view3d(C));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -602,7 +602,7 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op)
|
||||
walk->rv3d->rflag |= RV3D_NAVIGATING;
|
||||
|
||||
walk->snap_context = ED_transform_snap_object_context_create_view3d(
|
||||
CTX_data_main(C), walk->scene, CTX_data_depsgraph(C), 0,
|
||||
walk->scene, CTX_data_depsgraph(C), 0,
|
||||
walk->ar, walk->v3d);
|
||||
|
||||
walk->v3d_camera_control = ED_view3d_cameracontrol_acquire(
|
||||
|
||||
@@ -580,7 +580,7 @@ static void initSnappingMode(TransInfo *t)
|
||||
if (t->spacetype == SPACE_VIEW3D) {
|
||||
if (t->tsnap.object_context == NULL) {
|
||||
t->tsnap.object_context = ED_transform_snap_object_context_create_view3d(
|
||||
G.main, t->scene, t->depsgraph, 0, t->ar, t->view);
|
||||
t->scene, t->depsgraph, 0, t->ar, t->view);
|
||||
|
||||
ED_transform_snap_object_context_set_editmesh_callbacks(
|
||||
t->tsnap.object_context,
|
||||
|
||||
@@ -113,7 +113,6 @@ typedef struct SnapObjectData_EditMesh {
|
||||
} SnapObjectData_EditMesh;
|
||||
|
||||
struct SnapObjectContext {
|
||||
Main *bmain;
|
||||
Scene *scene;
|
||||
Depsgraph *depsgraph;
|
||||
|
||||
@@ -2269,13 +2268,12 @@ static short snapObjectsRay(
|
||||
* \{ */
|
||||
|
||||
SnapObjectContext *ED_transform_snap_object_context_create(
|
||||
Main *bmain, Scene *scene, Depsgraph *depsgraph, int flag)
|
||||
Scene *scene, Depsgraph *depsgraph, int flag)
|
||||
{
|
||||
SnapObjectContext *sctx = MEM_callocN(sizeof(*sctx), __func__);
|
||||
|
||||
sctx->flag = flag;
|
||||
|
||||
sctx->bmain = bmain;
|
||||
sctx->scene = scene;
|
||||
sctx->depsgraph = depsgraph;
|
||||
|
||||
@@ -2286,11 +2284,11 @@ SnapObjectContext *ED_transform_snap_object_context_create(
|
||||
}
|
||||
|
||||
SnapObjectContext *ED_transform_snap_object_context_create_view3d(
|
||||
Main *bmain, Scene *scene, Depsgraph *depsgraph, int flag,
|
||||
Scene *scene, Depsgraph *depsgraph, int flag,
|
||||
/* extra args for view3d */
|
||||
const ARegion *ar, const View3D *v3d)
|
||||
{
|
||||
SnapObjectContext *sctx = ED_transform_snap_object_context_create(bmain, scene, depsgraph, flag);
|
||||
SnapObjectContext *sctx = ED_transform_snap_object_context_create(scene, depsgraph, flag);
|
||||
|
||||
sctx->use_v3d = true;
|
||||
sctx->v3d_data.ar = ar;
|
||||
|
||||
@@ -172,7 +172,7 @@ static void rna_Scene_ray_cast(
|
||||
|
||||
Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true);
|
||||
SnapObjectContext *sctx = ED_transform_snap_object_context_create(
|
||||
G.main, scene, depsgraph, 0);
|
||||
scene, depsgraph, 0);
|
||||
|
||||
bool ret = ED_transform_snap_object_project_ray_ex(
|
||||
sctx,
|
||||
|
||||
Reference in New Issue
Block a user