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>2011-09-09 06:21:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-09 06:21:57 +0400
commit0727893231240c840c45ae29a7c7f8c9f2d46ade (patch)
tree5660661932fee69d98dacfb56f3f006377c3908c /source/blender
parentd841067c350de06f5538a2c8cddff9d0b9e2c81c (diff)
remove mesh and object arguments from bmesh operators, these are stored within the BMesh its self.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_mesh.h2
-rw-r--r--source/blender/blenkernel/intern/mesh.c4
-rw-r--r--source/blender/bmesh/bmesh.h2
-rw-r--r--source/blender/bmesh/intern/bmesh_inline.c5
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c9
-rw-r--r--source/blender/bmesh/operators/mesh_conv.c17
-rw-r--r--source/blender/editors/mesh/bmesh_tools.c2
-rw-r--r--source/blender/editors/mesh/bmeshutils.c10
8 files changed, 21 insertions, 30 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 93455f03a9e..71aa2d5c3ff 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -61,7 +61,7 @@ struct Scene;
extern "C" {
#endif
-struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me, struct Object *ob);
+struct BMesh *BKE_mesh_to_bmesh(struct Object *ob);
/*
this function recreates a tesselation.
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index a6e93622ace..4bd77e285de 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -569,14 +569,14 @@ Mesh *copy_mesh(Mesh *me)
return men;
}
-BMesh *BKE_mesh_to_bmesh(Mesh *me, Object *ob)
+BMesh *BKE_mesh_to_bmesh(Object *ob)
{
BMesh *bm;
int allocsize[4] = {512,512,2048,512};
bm = BM_Make_Mesh(ob, allocsize);
- BMO_CallOpf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%i", me, ob, 1);
+ BMO_CallOpf(bm, "mesh_to_bmesh set_shapekey=%i", 1);
return bm;
}
diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h
index 93632416d9e..3129b769f22 100644
--- a/source/blender/bmesh/bmesh.h
+++ b/source/blender/bmesh/bmesh.h
@@ -143,7 +143,7 @@ defining edges[0], and define the winding of the new face.*/
struct BMFace *BM_Make_Ngon ( struct BMesh *bm, struct BMVert *v1, struct BMVert *v2, struct BMEdge **edges, int len, int nodouble );
/*stuff for dealing with header flags*/
-BM_INLINE int BM_TestHFlag(void *element, const int flag);
+BM_INLINE int BM_TestHFlag(const void *element, const int flag);
/*stuff for dealing with header flags*/
BM_INLINE void BM_SetHFlag(void *element, const int flag);
diff --git a/source/blender/bmesh/intern/bmesh_inline.c b/source/blender/bmesh/intern/bmesh_inline.c
index f251063b8fb..88dab30a98e 100644
--- a/source/blender/bmesh/intern/bmesh_inline.c
+++ b/source/blender/bmesh/intern/bmesh_inline.c
@@ -3,10 +3,9 @@
#include "bmesh.h"
-BM_INLINE int BM_TestHFlag(void *element, const int flag)
+BM_INLINE int BM_TestHFlag(const void *element, const int flag)
{
- BMHeader *e = element;
- return e->flag & flag;
+ return ((BMHeader *)element)->flag & flag;
}
/*stuff for dealing with header flags*/
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index 6f57a944966..2f3a1871013 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -497,7 +497,6 @@ static BMOpDefine def_transform = {
static BMOpDefine def_object_load_bmesh = {
"object_load_bmesh",
{{BMOP_OPSLOT_PNT, "scene"},
- {BMOP_OPSLOT_PNT, "object"},
{0, /*null-terminating sentinel*/}},
object_load_bmesh_exec,
0,
@@ -511,9 +510,7 @@ static BMOpDefine def_object_load_bmesh = {
*/
static BMOpDefine def_bmesh_to_mesh = {
"bmesh_to_mesh",
- {{BMOP_OPSLOT_PNT, "mesh"}, //pointer to a mesh structure to fill in
- {BMOP_OPSLOT_PNT, "object"}, //pointer to an object structure
- {BMOP_OPSLOT_INT, "notesselation"}, //don't calculate mfaces
+ {{BMOP_OPSLOT_INT, "notesselation"}, //don't calculate mfaces
{0, /*null-terminating sentinel*/}},
bmesh_to_mesh_exec,
0,
@@ -527,9 +524,7 @@ static BMOpDefine def_bmesh_to_mesh = {
*/
static BMOpDefine def_mesh_to_bmesh = {
"mesh_to_bmesh",
- {{BMOP_OPSLOT_PNT, "mesh"}, //pointer to a Mesh structure
- {BMOP_OPSLOT_PNT, "object"}, //pointer to an Object structure
- {BMOP_OPSLOT_INT, "set_shapekey"}, //load active shapekey coordinates into verts
+ {{BMOP_OPSLOT_INT, "set_shapekey"}, //load active shapekey coordinates into verts
{0, /*null-terminating sentinel*/}},
mesh_to_bmesh_exec,
0
diff --git a/source/blender/bmesh/operators/mesh_conv.c b/source/blender/bmesh/operators/mesh_conv.c
index f981e6f7e73..9183fadd8a6 100644
--- a/source/blender/bmesh/operators/mesh_conv.c
+++ b/source/blender/bmesh/operators/mesh_conv.c
@@ -44,8 +44,8 @@
*/
void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) {
- Object *ob = BMO_Get_Pnt(op, "object");
- Mesh *me = BMO_Get_Pnt(op, "mesh");
+ Object *ob = bm->ob;
+ Mesh *me = ob->data;
MVert *mvert;
BLI_array_declare(verts);
MEdge *medge;
@@ -347,12 +347,9 @@ static void loops_to_corners(BMesh *bm, Mesh *me, int findex,
}
}
-void object_load_bmesh_exec(BMesh *bm, BMOperator *op) {
- Object *ob = BMO_Get_Pnt(op, "object");
- /* Scene *scene = BMO_Get_Pnt(op, "scene"); */
- Mesh *me = ob->data;
-
- BMO_CallOpf(bm, "bmesh_to_mesh mesh=%p object=%p", me, ob);
+void object_load_bmesh_exec(BMesh *bm, BMOperator *UNUSED(op))
+{
+ BMO_CallOpf(bm, "bmesh_to_mesh");
}
@@ -396,8 +393,8 @@ static BMVert **bmesh_to_mesh_vertex_map(BMesh *bm, int ototvert)
}
void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
- Mesh *me = BMO_Get_Pnt(op, "mesh");
- /* Object *ob = BMO_Get_Pnt(op, "object"); */
+ Object *ob = bm->ob;
+ Mesh *me = ob->data;
MLoop *mloop;
KeyBlock *block;
MPoly *mpoly;
diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c
index 726b4b77660..7f791e02f13 100644
--- a/source/blender/editors/mesh/bmesh_tools.c
+++ b/source/blender/editors/mesh/bmesh_tools.c
@@ -3562,7 +3562,7 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_SELECT, DEL_VERTS);
BM_Compute_Normals(bmnew);
- BMO_CallOpf(bmnew, "bmesh_to_mesh mesh=%p object=%p", basenew->object->data, basenew->object);
+ BMO_CallOpf(bmnew, "bmesh_to_mesh");
BM_Free_Mesh(bmnew);
((Mesh*)basenew->object->data)->edit_btmesh = NULL;
diff --git a/source/blender/editors/mesh/bmeshutils.c b/source/blender/editors/mesh/bmeshutils.c
index 6d45587a814..2aa806f48fd 100644
--- a/source/blender/editors/mesh/bmeshutils.c
+++ b/source/blender/editors/mesh/bmeshutils.c
@@ -270,9 +270,9 @@ void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
printf("yeek!! bmesh conversion issue! may lose lots of geometry!\n");
/*BMESH_TODO need to write smarter code here*/
- bm = BKE_mesh_to_bmesh(me, ob);
+ bm = BKE_mesh_to_bmesh(ob);
} else {
- bm = BKE_mesh_to_bmesh(me, ob);
+ bm = BKE_mesh_to_bmesh(ob);
}
me->edit_btmesh = BMEdit_Create(bm);
@@ -286,7 +286,7 @@ void EDBM_LoadEditBMesh(Scene *scene, Object *ob)
Mesh *me = ob->data;
BMesh *bm = me->edit_btmesh->bm;
- BMO_CallOpf(bm, "object_load_bmesh scene=%p object=%p", scene, ob);
+ BMO_CallOpf(bm, "object_load_bmesh scene=%p", scene);
}
void EDBM_FreeEditBMesh(BMEditMesh *tm)
@@ -580,7 +580,7 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata)
BMEdit_RecalcTesselation throughout the code.*/
BMEdit_RecalcTesselation(em);
- BMO_CallOpf(em->bm, "bmesh_to_mesh mesh=%p notesselation=%i", me, 1);
+ BMO_CallOpf(em->bm, "bmesh_to_mesh notesselation=%i", 1);
me->selectmode = em->selectmode;
return me;
@@ -600,7 +600,7 @@ static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata))
BMEdit_Free(em);
bm = BM_Make_Mesh(ob, allocsize);
- BMO_CallOpf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%i", me, ob, 0);
+ BMO_CallOpf(bm, "mesh_to_bmesh set_shapekey=%i", 0);
em2 = BMEdit_Create(bm);
*em = *em2;