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:
authorCampbell Barton <ideasman42@gmail.com>2020-01-07 05:49:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-07 05:53:03 +0300
commita8d11995bfcb16d2ecdfdb196e0ed708d8cf5c36 (patch)
treec6a885ab1f2814b1cad27344e819705b232360a7 /source/blender
parent592e245a90e250167956e95cc949577ecd4430a1 (diff)
BMesh: remove BMEditMesh.ob use for vert coord access, projection
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_editmesh.h7
-rw-r--r--source/blender/blenkernel/intern/editmesh.c9
-rw-r--r--source/blender/editors/include/ED_mesh.h1
-rw-r--r--source/blender/editors/mesh/editmesh_extrude.c4
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c4
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c4
6 files changed, 18 insertions, 11 deletions
diff --git a/source/blender/blenkernel/BKE_editmesh.h b/source/blender/blenkernel/BKE_editmesh.h
index 7c27362e244..3f9206ac9f8 100644
--- a/source/blender/blenkernel/BKE_editmesh.h
+++ b/source/blender/blenkernel/BKE_editmesh.h
@@ -92,8 +92,11 @@ BMEditMesh *BKE_editmesh_from_object(struct Object *ob);
void BKE_editmesh_free_derivedmesh(BMEditMesh *em);
void BKE_editmesh_free(BMEditMesh *em);
-float (*BKE_editmesh_vert_coords_alloc(
- struct Depsgraph *depsgraph, struct BMEditMesh *em, struct Scene *scene, int *r_vert_len))[3];
+float (*BKE_editmesh_vert_coords_alloc(struct Depsgraph *depsgraph,
+ struct BMEditMesh *em,
+ struct Scene *scene,
+ struct Object *ob,
+ int *r_vert_len))[3];
float (*BKE_editmesh_vert_coords_alloc_orco(BMEditMesh *em, int *r_vert_len))[3];
void BKE_editmesh_lnorspace_update(BMEditMesh *em);
void BKE_editmesh_ensure_autosmooth(BMEditMesh *em);
diff --git a/source/blender/blenkernel/intern/editmesh.c b/source/blender/blenkernel/intern/editmesh.c
index 1065f11a521..d7c52fc16ae 100644
--- a/source/blender/blenkernel/intern/editmesh.c
+++ b/source/blender/blenkernel/intern/editmesh.c
@@ -188,15 +188,18 @@ static void cage_mapped_verts_callback(void *userData,
}
}
-float (*BKE_editmesh_vert_coords_alloc(
- struct Depsgraph *depsgraph, BMEditMesh *em, struct Scene *scene, int *r_vert_len))[3]
+float (*BKE_editmesh_vert_coords_alloc(struct Depsgraph *depsgraph,
+ BMEditMesh *em,
+ struct Scene *scene,
+ Object *ob,
+ int *r_vert_len))[3]
{
Mesh *cage;
BLI_bitmap *visit_bitmap;
struct CageUserData data;
float(*cos_cage)[3];
- cage = editbmesh_get_eval_cage(depsgraph, scene, em->ob, em, &CD_MASK_BAREMESH);
+ cage = editbmesh_get_eval_cage(depsgraph, scene, ob, em, &CD_MASK_BAREMESH);
cos_cage = MEM_callocN(sizeof(*cos_cage) * em->bm->totvert, "bmbvh cos_cage");
/* when initializing cage verts, we only want the first cage coordinate for each vertex,
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 246dba57bb5..e398e5def9e 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -295,6 +295,7 @@ void ED_keymap_mesh(struct wmKeyConfig *keyconf);
void EDBM_project_snap_verts(struct bContext *C,
struct Depsgraph *depsgraph,
struct ARegion *ar,
+ struct Object *obedit,
struct BMEditMesh *em);
/* editface.c */
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c
index c1c8a208471..5496362024d 100644
--- a/source/blender/editors/mesh/editmesh_extrude.c
+++ b/source/blender/editors/mesh/editmesh_extrude.c
@@ -820,7 +820,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
/* also project the source, for retopo workflow */
if (use_proj) {
- EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.em);
+ EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.obedit, vc.em);
}
}
@@ -853,7 +853,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
}
if (use_proj) {
- EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.em);
+ EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.obedit, vc.em);
}
/* This normally happens when pushing undo but modal operators
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 4c4aa4214b2..1b6827dac87 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -2658,11 +2658,11 @@ static void knifetool_init_bmbvh(KnifeTool_OpData *kcd)
BM_mesh_elem_index_ensure(kcd->em->bm, BM_VERT);
Scene *scene_eval = (Scene *)DEG_get_evaluated_id(kcd->vc.depsgraph, &kcd->scene->id);
- Object *obedit_eval = (Object *)DEG_get_evaluated_id(kcd->vc.depsgraph, &kcd->em->ob->id);
+ Object *obedit_eval = (Object *)DEG_get_evaluated_id(kcd->vc.depsgraph, &kcd->ob->id);
BMEditMesh *em_eval = BKE_editmesh_from_object(obedit_eval);
kcd->cagecos = (const float(*)[3])BKE_editmesh_vert_coords_alloc(
- kcd->vc.depsgraph, em_eval, scene_eval, NULL);
+ kcd->vc.depsgraph, em_eval, scene_eval, obedit_eval, NULL);
kcd->bmbvh = BKE_bmbvh_new_from_editmesh(
kcd->em,
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index abc0d258e55..a795966693f 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -411,10 +411,10 @@ void MESH_OT_unsubdivide(wmOperatorType *ot)
ot->srna, "iterations", 2, 1, 1000, "Iterations", "Number of times to unsubdivide", 1, 100);
}
-void EDBM_project_snap_verts(bContext *C, Depsgraph *depsgraph, ARegion *ar, BMEditMesh *em)
+void EDBM_project_snap_verts(
+ bContext *C, Depsgraph *depsgraph, ARegion *ar, Object *obedit, BMEditMesh *em)
{
Main *bmain = CTX_data_main(C);
- Object *obedit = em->ob;
BMIter iter;
BMVert *eve;