Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_extrude.c
| Show First 20 Lines • Show All 652 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Dupli-Extrude Operator | /** \name Dupli-Extrude Operator | ||||
| * | * | ||||
| * Add-click-mesh (extrude) operator. | * Add-click-mesh (extrude) operator. | ||||
| * \{ */ | * \{ */ | ||||
| static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| { | { | ||||
| struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | |||||
| ViewContext vc; | ViewContext vc; | ||||
| BMVert *v1; | BMVert *v1; | ||||
| BMIter iter; | BMIter iter; | ||||
| float center[3]; | float center[3]; | ||||
| uint verts_len; | uint verts_len; | ||||
| em_setup_viewcontext(C, &vc); | em_setup_viewcontext(C, &vc); | ||||
| const Object *object_active = vc.obact; | const Object *object_active = vc.obact; | ||||
| ▲ Show 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | if (verts_len != 0) { | ||||
| } | } | ||||
| if (rot_src) { | if (rot_src) { | ||||
| EDBM_op_callf( | EDBM_op_callf( | ||||
| vc.em, op, "rotate verts=%hv cent=%v matrix=%m3", BM_ELEM_SELECT, local_center, mat); | vc.em, op, "rotate verts=%hv cent=%v matrix=%m3", BM_ELEM_SELECT, local_center, mat); | ||||
| /* also project the source, for retopo workflow */ | /* also project the source, for retopo workflow */ | ||||
| if (use_proj) { | if (use_proj) { | ||||
| EDBM_project_snap_verts(C, vc.ar, vc.em); | EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.em); | ||||
| } | } | ||||
| } | } | ||||
| edbm_extrude_ex(vc.obedit, vc.em, extrude_htype, BM_ELEM_SELECT, false, true, true); | edbm_extrude_ex(vc.obedit, vc.em, extrude_htype, BM_ELEM_SELECT, false, true, true); | ||||
| EDBM_op_callf( | EDBM_op_callf( | ||||
| vc.em, op, "rotate verts=%hv cent=%v matrix=%m3", BM_ELEM_SELECT, local_center, mat); | vc.em, op, "rotate verts=%hv cent=%v matrix=%m3", BM_ELEM_SELECT, local_center, mat); | ||||
| EDBM_op_callf(vc.em, op, "translate verts=%hv vec=%v", BM_ELEM_SELECT, ofs); | EDBM_op_callf(vc.em, op, "translate verts=%hv vec=%v", BM_ELEM_SELECT, ofs); | ||||
| } | } | ||||
| Show All 16 Lines | else { | ||||
| } | } | ||||
| if (!EDBM_op_finish(vc.em, &bmop, op, true)) { | if (!EDBM_op_finish(vc.em, &bmop, op, true)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| if (use_proj) { | if (use_proj) { | ||||
| EDBM_project_snap_verts(C, vc.ar, vc.em); | EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.em); | ||||
| } | } | ||||
| /* This normally happens when pushing undo but modal operators | /* This normally happens when pushing undo but modal operators | ||||
| * like this one don't push undo data until after modal mode is | * like this one don't push undo data until after modal mode is | ||||
| * done. */ | * done. */ | ||||
| EDBM_mesh_normals_update(vc.em); | EDBM_mesh_normals_update(vc.em); | ||||
| EDBM_update_generic(vc.em, true, true); | EDBM_update_generic(vc.em, true, true); | ||||
| Show All 32 Lines | |||||