Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_tools.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 405 Lines • ▼ Show 20 Lines | void MESH_OT_unsubdivide(wmOperatorType *ot) | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* props */ | /* props */ | ||||
| RNA_def_int( | RNA_def_int( | ||||
| ot->srna, "iterations", 2, 1, 1000, "Iterations", "Number of times to unsubdivide", 1, 100); | ot->srna, "iterations", 2, 1, 1000, "Iterations", "Number of times to unsubdivide", 1, 100); | ||||
| } | } | ||||
| void EDBM_project_snap_verts(bContext *C, ARegion *ar, BMEditMesh *em) | void EDBM_project_snap_verts(bContext *C, Depsgraph *depsgraph, ARegion *ar, BMEditMesh *em) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Object *obedit = em->ob; | Object *obedit = em->ob; | ||||
| BMIter iter; | BMIter iter; | ||||
| BMVert *eve; | BMVert *eve; | ||||
| ED_view3d_init_mats_rv3d(obedit, ar->regiondata); | ED_view3d_init_mats_rv3d(obedit, ar->regiondata); | ||||
| struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d( | struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d( | ||||
| bmain, CTX_data_scene(C), CTX_data_depsgraph(C), 0, ar, CTX_wm_view3d(C)); | bmain, CTX_data_scene(C), depsgraph, 0, ar, CTX_wm_view3d(C)); | ||||
brecht: Better to make the depsgraph a function parameter then, otherwise it's quite hidden. | |||||
| BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) { | BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) { | ||||
| if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) { | if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) { | ||||
| float mval[2], co_proj[3]; | float mval[2], co_proj[3]; | ||||
| if (ED_view3d_project_float_object(ar, eve->co, mval, V3D_PROJ_TEST_NOP) == | if (ED_view3d_project_float_object(ar, eve->co, mval, V3D_PROJ_TEST_NOP) == | ||||
| V3D_PROJ_RET_OK) { | V3D_PROJ_RET_OK) { | ||||
| if (ED_transform_snap_object_project_view3d(snap_context, | if (ED_transform_snap_object_project_view3d(snap_context, | ||||
| SCE_SNAP_MODE_FACE, | SCE_SNAP_MODE_FACE, | ||||
| ▲ Show 20 Lines • Show All 8,674 Lines • Show Last 20 Lines | |||||
Better to make the depsgraph a function parameter then, otherwise it's quite hidden.