Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_snap.c
| Show First 20 Lines • Show All 778 Lines • ▼ Show 20 Lines | for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | ||||
| if (obedit->type == OB_MESH) { | if (obedit->type == OB_MESH) { | ||||
| BMEditMesh *em = BKE_editmesh_from_object(obedit); | BMEditMesh *em = BKE_editmesh_from_object(obedit); | ||||
| if (em->bm->totvertsel == 0) { | if (em->bm->totvertsel == 0) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| Object *obedit_eval = DEG_get_evaluated_object(depsgraph, obedit); | |||||
| if (ED_transverts_check_obedit(obedit)) { | if (ED_transverts_check_obedit(obedit)) { | ||||
| ED_transverts_create_from_obedit(&tvs, obedit, TM_ALL_JOINTS | TM_SKIP_HANDLES); | ED_transverts_create_from_obedit(&tvs, obedit_eval, TM_ALL_JOINTS | TM_SKIP_HANDLES); | ||||
| } | } | ||||
| count += tvs.transverts_tot; | count += tvs.transverts_tot; | ||||
| if (tvs.transverts_tot != 0) { | if (tvs.transverts_tot != 0) { | ||||
| Object *obedit_eval = DEG_get_evaluated_object(depsgraph, obedit); | |||||
| copy_m3_m4(bmat, obedit_eval->obmat); | copy_m3_m4(bmat, obedit_eval->obmat); | ||||
| tv = tvs.transverts; | tv = tvs.transverts; | ||||
| for (int i = 0; i < tvs.transverts_tot; i++, tv++) { | for (int i = 0; i < tvs.transverts_tot; i++, tv++) { | ||||
| copy_v3_v3(vec, tv->loc); | copy_v3_v3(vec, tv->loc); | ||||
| mul_m3_v3(bmat, vec); | mul_m3_v3(bmat, vec); | ||||
| add_v3_v3(vec, obedit_eval->obmat[3]); | add_v3_v3(vec, obedit_eval->obmat[3]); | ||||
| add_v3_v3(centroid, vec); | add_v3_v3(centroid, vec); | ||||
| ▲ Show 20 Lines • Show All 227 Lines • Show Last 20 Lines | |||||