code cleanup: naming - BKE_mesh_*

This commit is contained in:
2012-05-05 21:28:12 +00:00
parent c0331cfc09
commit c91cee2bb9
40 changed files with 292 additions and 287 deletions

View File

@@ -63,7 +63,7 @@ void BKE_curve_make_local(struct Curve *cu);
short BKE_curve_type_get(struct Curve *cu);
void BKE_curve_type_test(struct Object *ob);
void BKE_curve_curve_dimension_update(struct Curve *cu);
void BKE_curve_tex_space_calc(struct Curve *cu);
void BKE_curve_texspace_calc(struct Curve *cu);
int BKE_curve_minmax(struct Curve *cu, float min[3], float max[3]);
int BKE_curve_center_median(struct Curve *cu, float cent[3]);

View File

@@ -51,7 +51,7 @@ int BKE_metaball_is_basis_for(struct Object *ob1, struct Object *ob2);
int BKE_metaball_is_basis(struct Object *ob);
struct Object *BKE_metaball_basis_find(struct Scene *scene, struct Object *ob);
void BKE_metaball_tex_space_calc(struct Object *ob);
void BKE_metaball_texspace_calc(struct Object *ob);
float *BKE_metaball_make_orco(struct Object *ob, struct ListBase *dispbase);
void BKE_metaball_properties_copy(struct Scene *scene, struct Object *active_object);

View File

@@ -76,109 +76,109 @@ struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me, struct Object *ob);
* if both of the above are 0, it'll use the indices of the mpolys of the MPoly
* data in pdata, and ignore the origindex layer altogether.
*/
int mesh_recalcTessellation(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata,
struct MVert *mvert,
int totface, int totloop, int totpoly,
const int do_face_normals);
int BKE_mesh_recalc_tessellation(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata,
struct MVert *mvert,
int totface, int totloop, int totpoly,
const int do_face_normals);
/* for forwards compat only quad->tri polys to mface, skip ngons.
*/
int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
struct CustomData *pdata, int totface, int totloop, int totpoly);
int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
struct CustomData *pdata, int totface, int totloop, int totpoly);
/*calculates a face normal.*/
void mesh_calc_poly_normal(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float no[3]);
void mesh_calc_poly_normal_coords(struct MPoly *mpoly, struct MLoop *loopstart,
const float (*vertex_coords)[3], float no[3]);
void BKE_mesh_calc_poly_normal_coords(struct MPoly *mpoly, struct MLoop *loopstart,
const float (*vertex_coords)[3], float no[3]);
void mesh_calc_poly_center(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float cent[3]);
void BKE_mesh_calc_poly_center(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float cent[3]);
float mesh_calc_poly_area(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float polynormal[3]);
float BKE_mesh_calc_poly_area(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float polynormal[3]);
/* Find the index of the loop in 'poly' which references vertex,
* returns -1 if not found */
int poly_find_loop_from_vert(const struct MPoly *poly,
const struct MLoop *loopstart,
unsigned vert);
const struct MLoop *loopstart,
unsigned vert);
/* Fill 'adj_r' with the loop indices in 'poly' adjacent to the
* vertex. Returns the index of the loop matching vertex, or -1 if the
* vertex is not in 'poly' */
int poly_get_adj_loops_from_vert(unsigned adj_r[3], const struct MPoly *poly,
const struct MLoop *mloop, unsigned vert);
const struct MLoop *mloop, unsigned vert);
/* update the hide flag for edges and polys from the corresponding
* flag in verts */
void mesh_flush_hidden_from_verts(const struct MVert *mvert,
const struct MLoop *mloop,
struct MEdge *medge, int totedge,
struct MPoly *mpoly, int totpoly);
void BKE_mesh_flush_hidden_from_verts(const struct MVert *mvert,
const struct MLoop *mloop,
struct MEdge *medge, int totedge,
struct MPoly *mpoly, int totpoly);
void unlink_mesh(struct Mesh *me);
void BKE_mesh_unlink(struct Mesh *me);
void BKE_mesh_free(struct Mesh *me, int unlink);
struct Mesh *BKE_mesh_add(const char *name);
struct Mesh *BKE_mesh_copy(struct Mesh *me);
void mesh_update_customdata_pointers(struct Mesh *me, const short do_ensure_tess_cd);
void BKE_mesh_make_local(struct Mesh *me);
void boundbox_mesh(struct Mesh *me, float *loc, float *size);
void tex_space_mesh(struct Mesh *me);
float *get_mesh_orco_verts(struct Object *ob);
void transform_mesh_orco_verts(struct Mesh *me, float (*orco)[3], int totvert, int invert);
void BKE_mesh_boundbox_calc(struct Mesh *me, float *loc, float *size);
void BKE_mesh_texspace_calc(struct Mesh *me);
float *BKE_mesh_orco_verts_get(struct Object *ob);
void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totvert, int invert);
int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr);
struct Mesh *BKE_mesh_from_object(struct Object *ob);
void set_mesh(struct Object *ob, struct Mesh *me);
void mball_to_mesh(struct ListBase *lb, struct Mesh *me);
int nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *totvert,
struct MEdge **alledge, int *totedge, struct MLoop **allloop, struct MPoly **allpoly,
int *totloop, int *totpoly);
int nurbs_to_mdata_customdb(struct Object *ob, struct ListBase *dispbase, struct MVert **allvert, int *_totvert,
struct MEdge **alledge, int *_totedge, struct MLoop **allloop, struct MPoly **allpoly,
int *_totloop, int *_totpoly);
void nurbs_to_mesh(struct Object *ob);
void mesh_to_curve(struct Scene *scene, struct Object *ob);
void BKE_mesh_from_metaball(struct ListBase *lb, struct Mesh *me);
int BKE_mesh_nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *totvert,
struct MEdge **alledge, int *totedge, struct MLoop **allloop, struct MPoly **allpoly,
int *totloop, int *totpoly);
int BKE_mesh_nurbs_to_mdata_customdb(struct Object *ob, struct ListBase *dispbase, struct MVert **allvert, int *_totvert,
struct MEdge **alledge, int *_totedge, struct MLoop **allloop, struct MPoly **allpoly,
int *_totloop, int *_totpoly);
void BKE_mesh_from_nurbs(struct Object *ob);
void BKE_mesh_from_curve(struct Scene *scene, struct Object *ob);
void free_dverts(struct MDeformVert *dvert, int totvert);
void copy_dverts(struct MDeformVert *dst, struct MDeformVert *src, int totvert); /* __NLA */
void mesh_delete_material_index(struct Mesh *me, short index);
void mesh_set_smooth_flag(struct Object *meshOb, int enableSmooth);
void BKE_mesh_delete_material_index(struct Mesh *me, short index);
void BKE_mesh_smooth_flag_set(struct Object *meshOb, int enableSmooth);
void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh);
void mesh_calc_normals_tessface(struct MVert *mverts, int numVerts, struct MFace *mfaces, int numFaces, float (*faceNors_r)[3]);
void BKE_mesh_calc_normals_tessface(struct MVert *mverts, int numVerts, struct MFace *mfaces, int numFaces, float (*faceNors_r)[3]);
/* used for unit testing; compares two meshes, checking only
* differences we care about. should be usable with leaf's
* testing framework I get RNA work done, will use hackish
* testing code for now.*/
const char *mesh_cmp(struct Mesh *me1, struct Mesh *me2, float thresh);
const char *BKE_mesh_cmp(struct Mesh *me1, struct Mesh *me2, float thresh);
struct BoundBox *mesh_get_bb(struct Object *ob);
void mesh_get_texspace(struct Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]);
struct BoundBox *BKE_mesh_boundbox_get(struct Object *ob);
void BKE_mesh_texspace_get(struct Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]);
/* if old, it converts mface->edcode to edge drawflags */
void make_edges(struct Mesh *me, int old);
void BKE_mesh_make_edges(struct Mesh *me, int old);
void mesh_strip_loose_faces(struct Mesh *me); /* Needed for compatibility (some old read code). */
void mesh_strip_loose_polysloops(struct Mesh *me);
void mesh_strip_loose_edges(struct Mesh *me);
void BKE_mesh_strip_loose_faces(struct Mesh *me); /* Needed for compatibility (some old read code). */
void BKE_mesh_strip_loose_polysloops(struct Mesh *me);
void BKE_mesh_strip_loose_edges(struct Mesh *me);
/* Calculate vertex and face normals, face normals are returned in *faceNors_r if non-NULL
* and vertex normals are stored in actual mverts.
*/
void mesh_calc_normals_mapping(
void BKE_mesh_calc_normals_mapping(
struct MVert *mverts, int numVerts,
struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3],
struct MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3]);
/* extended version of 'mesh_calc_normals' with option not to calc vertex normals */
void mesh_calc_normals_mapping_ex(
/* extended version of 'BKE_mesh_calc_normals' with option not to calc vertex normals */
void BKE_mesh_calc_normals_mapping_ex(
struct MVert *mverts, int numVerts,
struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3],
struct MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3],
const short only_face_normals);
void mesh_calc_normals(
void BKE_mesh_calc_normals(
struct MVert *mverts, int numVerts,
struct MLoop *mloop, struct MPoly *mpolys,
int numLoops, int numPolys, float (*polyNors_r)[3]);
@@ -246,9 +246,10 @@ typedef struct UvElementMap {
* to make that many islands, he can bite me :p */
#define INVALID_ISLAND 0xFFFF
UvVertMap *make_uv_vert_map(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv, unsigned int totpoly, unsigned int totvert, int selected, float *limit);
UvMapVert *get_uv_map_vert(UvVertMap *vmap, unsigned int v);
void free_uv_vert_map(UvVertMap *vmap);
UvVertMap *BKE_mesh_uv_vert_map_make(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
unsigned int totpoly, unsigned int totvert, int selected, float *limit);
UvMapVert *BKE_mesh_uv_vert_map_get_vert(UvVertMap *vmap, unsigned int v);
void BKE_mesh_uv_vert_map_free(UvVertMap *vmap);
/* Connectivity data */
typedef struct MeshElemMap {
@@ -270,10 +271,10 @@ void create_vert_edge_map(struct ListBase **map, IndexNode **mem, const struct M
/* vertex level transformations & checks (no derived mesh) */
int minmax_mesh(struct Mesh *me, float min[3], float max[3]);
int mesh_center_median(struct Mesh *me, float cent[3]);
int mesh_center_bounds(struct Mesh *me, float cent[3]);
void mesh_translate(struct Mesh *me, float offset[3], int do_keys);
int BKE_mesh_minmax(struct Mesh *me, float r_min[3], float r_max[3]);
int BKE_mesh_center_median(struct Mesh *me, float cent[3]);
int BKE_mesh_center_bounds(struct Mesh *me, float cent[3]);
void BKE_mesh_translate(struct Mesh *me, float offset[3], int do_keys);
/* mesh_validate.c */
/* XXX Loop v/e are unsigned, so using max uint_32 value as invalid marker... */
@@ -298,10 +299,10 @@ void BKE_mesh_tessface_ensure(struct Mesh *mesh);
void BKE_mesh_tessface_clear(struct Mesh *mesh);
/* Convert a triangle or quadrangle of loop/poly data to tessface data */
void mesh_loops_to_mface_corners(struct CustomData *fdata, struct CustomData *ldata,
struct CustomData *pdata, int lindex[4], int findex,
const int polyindex, const int mf_len,
const int numTex, const int numCol, const int hasPCol, const int hasOrigSpace);
void BKE_mesh_loops_to_mface_corners(struct CustomData *fdata, struct CustomData *ldata,
struct CustomData *pdata, int lindex[4], int findex,
const int polyindex, const int mf_len,
const int numTex, const int numCol, const int hasPCol, const int hasOrigSpace);
#ifdef __cplusplus
}

View File

@@ -446,10 +446,10 @@ void DM_update_tessface_data(DerivedMesh *dm)
not_done--;
}
}
mesh_loops_to_mface_corners(fdata, ldata, pdata,
ml_idx, mf_idx, polyindex[mf_idx],
mf_len,
numTex, numCol, hasPCol, hasOrigSpace);
BKE_mesh_loops_to_mface_corners(fdata, ldata, pdata,
ml_idx, mf_idx, polyindex[mf_idx],
mf_len,
numTex, numCol, hasPCol, hasOrigSpace);
}
if (G.debug & G_DEBUG)
@@ -870,7 +870,7 @@ static void *get_orco_coords_dm(Object *ob, BMEditMesh *em, int layer, int *free
if (em)
return (float(*)[3])get_editbmesh_orco_verts(em);
else
return (float(*)[3])get_mesh_orco_verts(ob);
return (float(*)[3])BKE_mesh_orco_verts_get(ob);
}
else if (layer == CD_CLOTH_ORCO) {
/* apply shape key for cloth, this should really be solved
@@ -932,7 +932,7 @@ static void add_orco_dm(Object *ob, BMEditMesh *em, DerivedMesh *dm,
if (orco) {
if (layer == CD_ORCO)
transform_mesh_orco_verts(ob->data, orco, totvert, 0);
BKE_mesh_orco_verts_transform(ob->data, orco, totvert, 0);
if (!(layerorco = DM_get_vert_data_layer(dm, layer))) {
DM_add_vert_layer(dm, layer, CD_CALLOC, NULL);

View File

@@ -931,8 +931,8 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
dm= mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH);
if (G.rendering) {
vdd.orco= (float(*)[3])get_mesh_orco_verts(par);
transform_mesh_orco_verts(me, vdd.orco, me->totvert, 0);
vdd.orco= (float(*)[3])BKE_mesh_orco_verts_get(par);
BKE_mesh_orco_verts_transform(me, vdd.orco, me->totvert, 0);
}
else
vdd.orco= NULL;
@@ -1063,8 +1063,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
if (G.rendering) {
orco= (float(*)[3])get_mesh_orco_verts(par);
transform_mesh_orco_verts(me, orco, me->totvert, 0);
orco= (float(*)[3])BKE_mesh_orco_verts_get(par);
BKE_mesh_orco_verts_transform(me, orco, me->totvert, 0);
mloopuv= me->mloopuv;
}
else {
@@ -1143,7 +1143,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
}
/* translation */
mesh_calc_poly_center(mp, loopstart, mvert, cent);
BKE_mesh_calc_poly_center(mp, loopstart, mvert, cent);
mul_m4_v3(pmat, cent);
@@ -1160,7 +1160,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
/* scale */
if (par->transflag & OB_DUPLIFACES_SCALE) {
float size= mesh_calc_poly_area(mp, loopstart, mvert, NULL);
float size= BKE_mesh_calc_poly_area(mp, loopstart, mvert, NULL);
size= sqrtf(size) * par->dupfacesca;
mul_m3_fl(mat, size);
}

View File

@@ -1521,10 +1521,10 @@ void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
{
CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
dm->numTessFaceData = mesh_recalcTessellation(&dm->faceData, &dm->loopData, &dm->polyData,
cddm->mvert,
dm->numTessFaceData, dm->numLoopData, dm->numPolyData,
do_face_nor_cpy);
dm->numTessFaceData = BKE_mesh_recalc_tessellation(&dm->faceData, &dm->loopData, &dm->polyData,
cddm->mvert,
dm->numTessFaceData, dm->numLoopData, dm->numPolyData,
do_face_nor_cpy);
if (!CustomData_get_layer(&dm->faceData, CD_ORIGINDEX)) {
int *polyIndex = CustomData_get_layer(&dm->faceData, CD_POLYINDEX);
@@ -1723,8 +1723,9 @@ DerivedMesh *CDDM_from_curve_customDB(Object *ob, ListBase *dispbase)
MPoly *allpoly;
int totvert, totedge, totloop, totpoly;
if (nurbs_to_mdata_customdb(ob, dispbase, &allvert, &totvert, &alledge,
&totedge, &allloop, &allpoly, &totloop, &totpoly) != 0) {
if (BKE_mesh_nurbs_to_mdata_customdb(ob, dispbase, &allvert, &totvert, &alledge,
&totedge, &allloop, &allpoly, &totloop, &totpoly) != 0)
{
/* Error initializing mdata. This often happens when curve is empty */
return CDDM_new(0, 0, 0, 0, 0);
}
@@ -2116,10 +2117,10 @@ void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals
face_nors = MEM_mallocN(sizeof(float)*3*dm->numTessFaceData, "face_nors");
/* calculate face normals */
mesh_calc_normals_mapping_ex(cddm->mvert, dm->numVertData, CDDM_get_loops(dm), CDDM_get_polys(dm),
dm->numLoopData, dm->numPolyData, NULL, cddm->mface, dm->numTessFaceData,
CustomData_get_layer(&dm->faceData, CD_POLYINDEX), face_nors,
only_face_normals);
BKE_mesh_calc_normals_mapping_ex(cddm->mvert, dm->numVertData, CDDM_get_loops(dm), CDDM_get_polys(dm),
dm->numLoopData, dm->numPolyData, NULL, cddm->mface, dm->numTessFaceData,
CustomData_get_layer(&dm->faceData, CD_POLYINDEX), face_nors,
only_face_normals);
CustomData_add_layer(&dm->faceData, CD_NORMAL, CD_ASSIGN,
face_nors, dm->numTessFaceData);
@@ -2151,8 +2152,8 @@ void CDDM_calc_normals(DerivedMesh *dm)
poly_nors = CustomData_add_layer(&dm->polyData, CD_NORMAL, CD_CALLOC, NULL, dm->numPolyData);
}
mesh_calc_normals(cddm->mvert, dm->numVertData, CDDM_get_loops(dm), CDDM_get_polys(dm),
dm->numLoopData, dm->numPolyData, poly_nors);
BKE_mesh_calc_normals(cddm->mvert, dm->numVertData, CDDM_get_loops(dm), CDDM_get_polys(dm),
dm->numLoopData, dm->numPolyData, poly_nors);
}
void CDDM_calc_normals_tessface(DerivedMesh *dm)
@@ -2171,8 +2172,8 @@ void CDDM_calc_normals_tessface(DerivedMesh *dm)
face_nors = CustomData_add_layer(&dm->faceData, CD_NORMAL, CD_CALLOC, NULL, dm->numTessFaceData);
}
mesh_calc_normals_tessface(cddm->mvert, dm->numVertData,
cddm->mface, dm->numTessFaceData, face_nors);
BKE_mesh_calc_normals_tessface(cddm->mvert, dm->numVertData,
cddm->mface, dm->numTessFaceData, face_nors);
}
#if 1

View File

@@ -354,7 +354,7 @@ void BKE_curve_type_test(Object *ob)
BKE_curve_curve_dimension_update((Curve *)ob->data);
}
void BKE_curve_tex_space_calc(Curve *cu)
void BKE_curve_texspace_calc(Curve *cu)
{
DispList *dl;
BoundBox *bb;

View File

@@ -674,7 +674,7 @@ void makeDispListMBall(Scene *scene, Object *ob)
if (ob->type==OB_MBALL) {
if (ob==BKE_metaball_basis_find(scene, ob)) {
BKE_metaball_polygonize(scene, ob, &ob->disp);
BKE_metaball_tex_space_calc(ob);
BKE_metaball_texspace_calc(ob);
object_deform_mball(ob, &ob->disp);
}
@@ -686,7 +686,7 @@ void makeDispListMBall(Scene *scene, Object *ob)
void makeDispListMBall_forRender(Scene *scene, Object *ob, ListBase *dispbase)
{
BKE_metaball_polygonize(scene, ob, dispbase);
BKE_metaball_tex_space_calc(ob);
BKE_metaball_texspace_calc(ob);
object_deform_mball(ob, dispbase);
}
@@ -1182,7 +1182,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
copy_displist(&cu->disp, dispbase);
if (!forRender) {
BKE_curve_tex_space_calc(cu);
BKE_curve_texspace_calc(cu);
}
if (!forOrco)
@@ -1451,7 +1451,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
copy_displist(&cu->disp, dispbase);
if (!forRender) {
BKE_curve_tex_space_calc(cu);
BKE_curve_texspace_calc(cu);
}
if (!forOrco) curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts);

View File

@@ -527,7 +527,7 @@ static void data_delete_material_index_id(ID *id, short index)
{
switch (GS(id->name)) {
case ID_ME:
mesh_delete_material_index((Mesh *)id, index);
BKE_mesh_delete_material_index((Mesh *)id, index);
break;
case ID_CU:
BKE_curve_delete_material_index((Curve *)id, index);

View File

@@ -346,7 +346,7 @@ MetaElem *BKE_metaball_element_add(MetaBall *mb, const int type)
* basic MetaBall (usually with name Meta). All other MetaBalls (with
* names Meta.001, Meta.002, etc) are included in this Bounding Box.
*/
void BKE_metaball_tex_space_calc(Object *ob)
void BKE_metaball_texspace_calc(Object *ob)
{
DispList *dl;
BoundBox *bb;

View File

@@ -277,7 +277,7 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
}
/*used for testing. returns an error string the two meshes don't match*/
const char *mesh_cmp(Mesh *me1, Mesh *me2, float thresh)
const char *BKE_mesh_cmp(Mesh *me1, Mesh *me2, float thresh)
{
int c;
@@ -392,7 +392,7 @@ void mesh_update_customdata_pointers(Mesh *me, const short do_ensure_tess_cd)
* we need a more generic method, like the expand() functions in
* readfile.c */
void unlink_mesh(Mesh *me)
void BKE_mesh_unlink(Mesh *me)
{
int a;
@@ -415,7 +415,7 @@ void unlink_mesh(Mesh *me)
void BKE_mesh_free(Mesh *me, int unlink)
{
if (unlink)
unlink_mesh(me);
BKE_mesh_unlink(me);
CustomData_free(&me->vdata, me->totvert);
CustomData_free(&me->edata, me->totedge);
@@ -658,7 +658,7 @@ void BKE_mesh_make_local(Mesh *me)
}
}
void boundbox_mesh(Mesh *me, float *loc, float *size)
void BKE_mesh_boundbox_calc(Mesh *me, float r_loc[3], float r_size[3])
{
BoundBox *bb;
float min[3], max[3];
@@ -667,30 +667,30 @@ void boundbox_mesh(Mesh *me, float *loc, float *size)
if (me->bb==NULL) me->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
bb= me->bb;
if (!loc) loc= mloc;
if (!size) size= msize;
if (!r_loc) r_loc= mloc;
if (!r_size) r_size= msize;
INIT_MINMAX(min, max);
if (!minmax_mesh(me, min, max)) {
if (!BKE_mesh_minmax(me, min, max)) {
min[0] = min[1] = min[2] = -1.0f;
max[0] = max[1] = max[2] = 1.0f;
}
mid_v3_v3v3(loc, min, max);
mid_v3_v3v3(r_loc, min, max);
size[0]= (max[0]-min[0])/2.0f;
size[1]= (max[1]-min[1])/2.0f;
size[2]= (max[2]-min[2])/2.0f;
r_size[0]= (max[0]-min[0])/2.0f;
r_size[1]= (max[1]-min[1])/2.0f;
r_size[2]= (max[2]-min[2])/2.0f;
BKE_boundbox_init_from_minmax(bb, min, max);
}
void tex_space_mesh(Mesh *me)
void BKE_mesh_texspace_calc(Mesh *me)
{
float loc[3], size[3];
int a;
boundbox_mesh(me, loc, size);
BKE_mesh_boundbox_calc(me, loc, size);
if (me->texflag & ME_AUTOSPACE) {
for (a=0; a<3; a++) {
@@ -705,7 +705,7 @@ void tex_space_mesh(Mesh *me)
}
}
BoundBox *mesh_get_bb(Object *ob)
BoundBox *BKE_mesh_boundbox_get(Object *ob)
{
Mesh *me= ob->data;
@@ -713,15 +713,15 @@ BoundBox *mesh_get_bb(Object *ob)
return ob->bb;
if (!me->bb)
tex_space_mesh(me);
BKE_mesh_texspace_calc(me);
return me->bb;
}
void mesh_get_texspace(Mesh *me, float r_loc[3], float r_rot[3], float r_size[3])
void BKE_mesh_texspace_get(Mesh *me, float r_loc[3], float r_rot[3], float r_size[3])
{
if (!me->bb) {
tex_space_mesh(me);
BKE_mesh_texspace_calc(me);
}
if (r_loc) copy_v3_v3(r_loc, me->loc);
@@ -729,7 +729,7 @@ void mesh_get_texspace(Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]
if (r_size) copy_v3_v3(r_size, me->size);
}
float *get_mesh_orco_verts(Object *ob)
float *BKE_mesh_orco_verts_get(Object *ob)
{
Mesh *me = ob->data;
MVert *mvert = NULL;
@@ -749,12 +749,12 @@ float *get_mesh_orco_verts(Object *ob)
return (float*)vcos;
}
void transform_mesh_orco_verts(Mesh *me, float (*orco)[3], int totvert, int invert)
void BKE_mesh_orco_verts_transform(Mesh *me, float (*orco)[3], int totvert, int invert)
{
float loc[3], size[3];
int a;
mesh_get_texspace(me->texcomesh?me->texcomesh:me, loc, NULL, size);
BKE_mesh_texspace_get(me->texcomesh ? me->texcomesh : me, loc, NULL, size);
if (invert) {
for (a=0; a<totvert; a++) {
@@ -962,7 +962,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll
}
final++;
(*alledge)= medge= MEM_callocN(sizeof (MEdge) * final, "make_edges mdge");
(*alledge)= medge= MEM_callocN(sizeof (MEdge) * final, "BKE_mesh_make_edges mdge");
(*_totedge)= final;
for (a=totedge, ed=edsort; a>1; a--, ed++) {
@@ -1015,7 +1015,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll
BLI_edgehash_free(hash, NULL);
}
void make_edges(Mesh *me, int old)
void BKE_mesh_make_edges(Mesh *me, int old)
{
MEdge *medge;
int totedge=0;
@@ -1032,11 +1032,11 @@ void make_edges(Mesh *me, int old)
me->medge= medge;
me->totedge= totedge;
mesh_strip_loose_faces(me);
BKE_mesh_strip_loose_faces(me);
}
/* We need to keep this for edge creation (for now?), and some old readfile code... */
void mesh_strip_loose_faces(Mesh *me)
void BKE_mesh_strip_loose_faces(Mesh *me)
{
MFace *f;
int a, b;
@@ -1060,7 +1060,7 @@ void mesh_strip_loose_faces(Mesh *me)
/* Note: It won't try to guess which loops of an invalid poly to remove!
* this is the work of the caller, to mark those loops...
* See e.g. BKE_mesh_validate_arrays(). */
void mesh_strip_loose_polysloops(Mesh *me)
void BKE_mesh_strip_loose_polysloops(Mesh *me)
{
MPoly *p;
MLoop *l;
@@ -1131,7 +1131,7 @@ void mesh_strip_loose_polysloops(Mesh *me)
MEM_freeN(new_idx);
}
void mesh_strip_loose_edges(Mesh *me)
void BKE_mesh_strip_loose_edges(Mesh *me)
{
MEdge *e;
MLoop *l;
@@ -1166,7 +1166,7 @@ void mesh_strip_loose_edges(Mesh *me)
MEM_freeN(new_idx);
}
void mball_to_mesh(ListBase *lb, Mesh *me)
void BKE_mesh_from_metaball(ListBase *lb, Mesh *me)
{
DispList *dl;
MVert *mvert;
@@ -1223,7 +1223,7 @@ void mball_to_mesh(ListBase *lb, Mesh *me)
mesh_update_customdata_pointers(me, TRUE);
mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
BKE_mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
BKE_mesh_calc_edges(me, TRUE);
}
@@ -1231,15 +1231,15 @@ void mball_to_mesh(ListBase *lb, Mesh *me)
/* Initialize mverts, medges and, faces for converting nurbs to mesh and derived mesh */
/* return non-zero on error */
int nurbs_to_mdata(Object *ob, MVert **allvert, int *totvert,
MEdge **alledge, int *totedge, MLoop **allloop, MPoly **allpoly,
int *totloop, int *totpoly)
int BKE_mesh_nurbs_to_mdata(Object *ob, MVert **allvert, int *totvert,
MEdge **alledge, int *totedge, MLoop **allloop, MPoly **allpoly,
int *totloop, int *totpoly)
{
return nurbs_to_mdata_customdb(ob, &ob->disp,
allvert, totvert,
alledge, totedge,
allloop, allpoly,
totloop, totpoly);
return BKE_mesh_nurbs_to_mdata_customdb(ob, &ob->disp,
allvert, totvert,
alledge, totedge,
allloop, allpoly,
totloop, totpoly);
}
/* BMESH: this doesn't calculate all edges from polygons,
@@ -1247,11 +1247,11 @@ int nurbs_to_mdata(Object *ob, MVert **allvert, int *totvert,
/* Initialize mverts, medges and, faces for converting nurbs to mesh and derived mesh */
/* use specified dispbase */
int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase,
MVert **allvert, int *_totvert,
MEdge **alledge, int *_totedge,
MLoop **allloop, MPoly **allpoly,
int *_totloop, int *_totpoly)
int BKE_mesh_nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase,
MVert **allvert, int *_totvert,
MEdge **alledge, int *_totedge,
MLoop **allloop, MPoly **allpoly,
int *_totloop, int *_totpoly)
{
DispList *dl;
Curve *cu;
@@ -1467,7 +1467,7 @@ int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase,
}
/* this may fail replacing ob->data, be sure to check ob->type */
void nurbs_to_mesh(Object *ob)
void BKE_mesh_from_nurbs(Object *ob)
{
Main *bmain= G.main;
Object *ob1;
@@ -1483,7 +1483,10 @@ void nurbs_to_mesh(Object *ob)
cu= ob->data;
if (dm == NULL) {
if (nurbs_to_mdata(ob, &allvert, &totvert, &alledge, &totedge, &allloop, &allpoly, &totloop, &totpoly) != 0) {
if (BKE_mesh_nurbs_to_mdata(ob, &allvert, &totvert,
&alledge, &totedge, &allloop,
&allpoly, &totloop, &totpoly) != 0)
{
/* Error initializing */
return;
}
@@ -1500,7 +1503,7 @@ void nurbs_to_mesh(Object *ob)
me->mloop= CustomData_add_layer(&me->ldata, CD_MLOOP, CD_ASSIGN, allloop, me->totloop);
me->mpoly= CustomData_add_layer(&me->pdata, CD_MPOLY, CD_ASSIGN, allpoly, me->totpoly);
mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
BKE_mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
BKE_mesh_calc_edges(me, TRUE);
}
@@ -1512,7 +1515,7 @@ void nurbs_to_mesh(Object *ob)
me->totcol= cu->totcol;
me->mat= cu->mat;
tex_space_mesh(me);
BKE_mesh_texspace_calc(me);
cu->mat= NULL;
cu->totcol= 0;
@@ -1560,7 +1563,7 @@ static void appendPolyLineVert(ListBase *lb, unsigned int index)
BLI_addtail(lb, vl);
}
void mesh_to_curve(Scene *scene, Object *ob)
void BKE_mesh_from_curve(Scene *scene, Object *ob)
{
/* make new mesh data from the original copy */
DerivedMesh *dm= mesh_get_derived_final(scene, ob, CD_MASK_MESH);
@@ -1732,7 +1735,7 @@ void mesh_to_curve(Scene *scene, Object *ob)
}
}
void mesh_delete_material_index(Mesh *me, short index)
void BKE_mesh_delete_material_index(Mesh *me, short index)
{
int i;
@@ -1749,7 +1752,7 @@ void mesh_delete_material_index(Mesh *me, short index)
}
}
void mesh_set_smooth_flag(Object *meshOb, int enableSmooth)
void BKE_mesh_smooth_flag_set(Object *meshOb, int enableSmooth)
{
Mesh *me = meshOb->data;
int i;
@@ -1777,16 +1780,16 @@ void mesh_set_smooth_flag(Object *meshOb, int enableSmooth)
}
}
void mesh_calc_normals_mapping(MVert *mverts, int numVerts,
void BKE_mesh_calc_normals_mapping(MVert *mverts, int numVerts,
MLoop *mloop, MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3],
MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3])
{
mesh_calc_normals_mapping_ex(mverts, numVerts, mloop, mpolys,
numLoops, numPolys, polyNors_r, mfaces, numFaces,
origIndexFace, faceNors_r, FALSE);
BKE_mesh_calc_normals_mapping_ex(mverts, numVerts, mloop, mpolys,
numLoops, numPolys, polyNors_r, mfaces, numFaces,
origIndexFace, faceNors_r, FALSE);
}
void mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
void BKE_mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
MLoop *mloop, MPoly *mpolys,
int numLoops, int numPolys, float (*polyNors_r)[3],
MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3],
@@ -1814,7 +1817,7 @@ void mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
if (only_face_normals == FALSE) {
/* vertex normals are optional, they require some extra calculations,
* so make them optional */
mesh_calc_normals(mverts, numVerts, mloop, mpolys, numLoops, numPolys, pnors);
BKE_mesh_calc_normals(mverts, numVerts, mloop, mpolys, numLoops, numPolys, pnors);
}
else {
/* only calc poly normals */
@@ -1836,7 +1839,7 @@ void mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
}
else {
/* eek, we're not corresponding to polys */
printf("error in mesh_calc_normals; tessellation face indices are incorrect. normals may look bad.\n");
printf("error in BKE_mesh_calc_normals; tessellation face indices are incorrect. normals may look bad.\n");
}
}
}
@@ -1848,8 +1851,8 @@ void mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
}
void mesh_calc_normals(MVert *mverts, int numVerts, MLoop *mloop, MPoly *mpolys,
int UNUSED(numLoops), int numPolys, float (*polyNors_r)[3])
void BKE_mesh_calc_normals(MVert *mverts, int numVerts, MLoop *mloop, MPoly *mpolys,
int UNUSED(numLoops), int numPolys, float (*polyNors_r)[3])
{
float (*pnors)[3] = polyNors_r;
@@ -1910,7 +1913,7 @@ void mesh_calc_normals(MVert *mverts, int numVerts, MLoop *mloop, MPoly *mpolys,
if (pnors != polyNors_r) MEM_freeN(pnors);
}
void mesh_calc_normals_tessface(MVert *mverts, int numVerts, MFace *mfaces, int numFaces, float (*faceNors_r)[3])
void BKE_mesh_calc_normals_tessface(MVert *mverts, int numVerts, MFace *mfaces, int numFaces, float (*faceNors_r)[3])
{
float (*tnorms)[3]= MEM_callocN(numVerts*sizeof(*tnorms), "tnorms");
float (*fnors)[3]= (faceNors_r)? faceNors_r: MEM_callocN(sizeof(*fnors)*numFaces, "meshnormals");
@@ -2132,7 +2135,7 @@ float (*mesh_getVertexCos(Mesh *me, int *numVerts_r))[3]
/* this replaces the non bmesh function (in trunk) which takes MTFace's, if we ever need it back we could
* but for now this replaces it because its unused. */
UvVertMap *make_uv_vert_map(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv, unsigned int totpoly, unsigned int totvert, int selected, float *limit)
UvVertMap *BKE_mesh_uv_vert_map_make(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv, unsigned int totpoly, unsigned int totvert, int selected, float *limit)
{
UvVertMap *vmap;
UvMapVert *buf;
@@ -2159,7 +2162,7 @@ UvVertMap *make_uv_vert_map(struct MPoly *mpoly, struct MLoop *mloop, struct MLo
buf= vmap->buf= (UvMapVert*)MEM_callocN(sizeof(*vmap->buf)*totuv, "UvMapVert");
if (!vmap->vert || !vmap->buf) {
free_uv_vert_map(vmap);
BKE_mesh_uv_vert_map_free(vmap);
return NULL;
}
@@ -2223,12 +2226,12 @@ UvVertMap *make_uv_vert_map(struct MPoly *mpoly, struct MLoop *mloop, struct MLo
return vmap;
}
UvMapVert *get_uv_map_vert(UvVertMap *vmap, unsigned int v)
UvMapVert *BKE_mesh_uv_vert_map_get_vert(UvVertMap *vmap, unsigned int v)
{
return vmap->vert[v];
}
void free_uv_vert_map(UvVertMap *vmap)
void BKE_mesh_uv_vert_map_free(UvVertMap *vmap)
{
if (vmap) {
if (vmap->vert) MEM_freeN(vmap->vert);
@@ -2302,17 +2305,17 @@ void create_vert_edge_map(ListBase **map, IndexNode **mem, const MEdge *medge, c
}
}
void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
CustomData *pdata, int lindex[4], int findex,
const int polyindex,
const int mf_len, /* 3 or 4 */
void BKE_mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
CustomData *pdata, int lindex[4], int findex,
const int polyindex,
const int mf_len, /* 3 or 4 */
/* cache values to avoid lookups every time */
const int numTex, /* CustomData_number_of_layers(pdata, CD_MTEXPOLY) */
const int numCol, /* CustomData_number_of_layers(ldata, CD_MLOOPCOL) */
const int hasPCol, /* CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL) */
const int hasOrigSpace /* CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP) */
)
/* cache values to avoid lookups every time */
const int numTex, /* CustomData_number_of_layers(pdata, CD_MTEXPOLY) */
const int numCol, /* CustomData_number_of_layers(ldata, CD_MLOOPCOL) */
const int hasPCol, /* CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL) */
const int hasOrigSpace /* CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP) */
)
{
MTFace *texface;
MTexPoly *texpoly;
@@ -2366,7 +2369,7 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
* this function recreates a tessellation.
* returns number of tessellation faces.
*/
int mesh_recalcTessellation(CustomData *fdata,
int BKE_mesh_recalc_tessellation(CustomData *fdata,
CustomData *ldata, CustomData *pdata,
MVert *mvert, int totface, int UNUSED(totloop),
int totpoly,
@@ -2618,14 +2621,14 @@ int mesh_recalcTessellation(CustomData *fdata,
if (mf_len == 4) mf->v4 = mloop[mf->v4].v;
#endif
mesh_loops_to_mface_corners(fdata, ldata, pdata,
lindex, mface_index, mface_to_poly_map[mface_index],
BKE_mesh_loops_to_mface_corners(fdata, ldata, pdata,
lindex, mface_index, mface_to_poly_map[mface_index],
#ifdef USE_TESSFACE_QUADS
mf_len,
mf_len,
#else
3,
3,
#endif
numTex, numCol, hasPCol, hasOrigSpace);
numTex, numCol, hasPCol, hasOrigSpace);
#ifdef USE_TESSFACE_QUADS
@@ -2647,7 +2650,7 @@ int mesh_recalcTessellation(CustomData *fdata,
* this function recreates a tessellation.
* returns number of tessellation faces.
*/
int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
struct CustomData *pdata, int totface, int UNUSED(totloop), int totpoly)
{
MLoop *mloop;
@@ -2719,9 +2722,9 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
mf->v2 = mloop[mf->v2].v;
mf->v3 = mloop[mf->v3].v;
mesh_loops_to_mface_corners(fdata, ldata, pdata,
lindex, k, i, 3,
numTex, numCol, hasPCol, hasOrigSpace);
BKE_mesh_loops_to_mface_corners(fdata, ldata, pdata,
lindex, k, i, 3,
numTex, numCol, hasPCol, hasOrigSpace);
test_index_face(mf, fdata, k, 3);
}
else {
@@ -2739,9 +2742,9 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
mf->v3 = mloop[mf->v3].v;
mf->v4 = mloop[mf->v4].v;
mesh_loops_to_mface_corners(fdata, ldata, pdata,
lindex, k, i, 4,
numTex, numCol, hasPCol, hasOrigSpace);
BKE_mesh_loops_to_mface_corners(fdata, ldata, pdata,
lindex, k, i, 4,
numTex, numCol, hasPCol, hasOrigSpace);
test_index_face(mf, fdata, k, 4);
}
@@ -2829,7 +2832,7 @@ static void mesh_calc_ngon_normal_coords(MPoly *mpoly, MLoop *loopstart,
}
}
void mesh_calc_poly_normal_coords(MPoly *mpoly, MLoop *loopstart,
void BKE_mesh_calc_poly_normal_coords(MPoly *mpoly, MLoop *loopstart,
const float (*vertex_coords)[3], float no[3])
{
if (mpoly->totloop > 4) {
@@ -2870,7 +2873,7 @@ static void mesh_calc_ngon_center(MPoly *mpoly, MLoop *loopstart,
}
}
void mesh_calc_poly_center(MPoly *mpoly, MLoop *loopstart,
void BKE_mesh_calc_poly_center(MPoly *mpoly, MLoop *loopstart,
MVert *mvarray, float cent[3])
{
if (mpoly->totloop == 3) {
@@ -2894,7 +2897,7 @@ void mesh_calc_poly_center(MPoly *mpoly, MLoop *loopstart,
}
/* note, passing polynormal is only a speedup so we can skip calculating it */
float mesh_calc_poly_area(MPoly *mpoly, MLoop *loopstart,
float BKE_mesh_calc_poly_area(MPoly *mpoly, MLoop *loopstart,
MVert *mvarray, float polynormal[3])
{
if (mpoly->totloop == 3) {
@@ -2974,7 +2977,7 @@ int poly_get_adj_loops_from_vert(unsigned adj_r[3], const MPoly *poly,
/* update the hide flag for edges and faces from the corresponding
* flag in verts */
void mesh_flush_hidden_from_verts(const MVert *mvert,
void BKE_mesh_flush_hidden_from_verts(const MVert *mvert,
const MLoop *mloop,
MEdge *medge, int totedge,
MPoly *mpoly, int totpoly)
@@ -3003,18 +3006,18 @@ void mesh_flush_hidden_from_verts(const MVert *mvert,
}
/* basic vertex data functions */
int minmax_mesh(Mesh *me, float min[3], float max[3])
int BKE_mesh_minmax(Mesh *me, float r_min[3], float r_max[3])
{
int i= me->totvert;
int i = me->totvert;
MVert *mvert;
for (mvert= me->mvert; i--; mvert++) {
DO_MINMAX(mvert->co, min, max);
for (mvert = me->mvert; i--; mvert++) {
DO_MINMAX(mvert->co, r_min, r_max);
}
return (me->totvert != 0);
}
int mesh_center_median(Mesh *me, float cent[3])
int BKE_mesh_center_median(Mesh *me, float cent[3])
{
int i= me->totvert;
MVert *mvert;
@@ -3030,11 +3033,11 @@ int mesh_center_median(Mesh *me, float cent[3])
return (me->totvert != 0);
}
int mesh_center_bounds(Mesh *me, float cent[3])
int BKE_mesh_center_bounds(Mesh *me, float cent[3])
{
float min[3], max[3];
INIT_MINMAX(min, max);
if (minmax_mesh(me, min, max)) {
if (BKE_mesh_minmax(me, min, max)) {
mid_v3_v3v3(cent, min, max);
return 1;
}
@@ -3042,7 +3045,7 @@ int mesh_center_bounds(Mesh *me, float cent[3])
return 0;
}
void mesh_translate(Mesh *me, float offset[3], int do_keys)
void BKE_mesh_translate(Mesh *me, float offset[3], int do_keys)
{
int i= me->totvert;
MVert *mvert;
@@ -3079,7 +3082,7 @@ void BKE_mesh_ensure_navmesh(Mesh *me)
void BKE_mesh_tessface_calc(Mesh *mesh)
{
mesh->totface = mesh_recalcTessellation(&mesh->fdata, &mesh->ldata, &mesh->pdata,
mesh->totface = BKE_mesh_recalc_tessellation(&mesh->fdata, &mesh->ldata, &mesh->pdata,
mesh->mvert,
mesh->totface, mesh->totloop, mesh->totpoly,
/* calc normals right after, don't copy from polys here */

View File

@@ -536,11 +536,11 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
if (mesh) {
if (do_polyloop_free) {
mesh_strip_loose_polysloops(mesh);
BKE_mesh_strip_loose_polysloops(mesh);
}
if (do_edge_free) {
mesh_strip_loose_edges(mesh);
BKE_mesh_strip_loose_edges(mesh);
}
if (do_edge_recalc) {

View File

@@ -779,7 +779,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
float no[3];
/* set up poly, loops, and coords in order to call
* mesh_calc_poly_normal_coords() */
* BKE_mesh_calc_poly_normal_coords() */
fake_poly.totloop = p->totloop;
fake_poly.loopstart = 0;
fake_loops = MEM_mallocN(sizeof(MLoop) * p->totloop, "fake_loops");
@@ -796,8 +796,8 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
copy_v3_v3(fake_co[k], origco[vndx]);
}
mesh_calc_poly_normal_coords(&fake_poly, fake_loops,
(const float(*)[3])fake_co, no);
BKE_mesh_calc_poly_normal_coords(&fake_poly, fake_loops,
(const float(*)[3])fake_co, no);
MEM_freeN(fake_loops);
MEM_freeN(fake_co);

View File

@@ -299,7 +299,7 @@ void BKE_object_free(Object *ob)
ID *id= ob->data;
id->us--;
if (id->us==0) {
if (ob->type==OB_MESH) unlink_mesh(ob->data);
if (ob->type==OB_MESH) BKE_mesh_unlink(ob->data);
else if (ob->type==OB_CURVE) BKE_curve_unlink(ob->data);
else if (ob->type==OB_MBALL) BKE_metaball_unlink(ob->data);
}
@@ -2180,7 +2180,7 @@ BoundBox *BKE_object_boundbox_get(Object *ob)
BoundBox *bb= NULL;
if (ob->type==OB_MESH) {
bb = mesh_get_bb(ob);
bb = BKE_mesh_boundbox_get(ob);
}
else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
bb= ob->bb ? ob->bb : ((Curve *)ob->data )->bb;
@@ -2254,7 +2254,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
{
Curve *cu= ob->data;
if (cu->bb==NULL) BKE_curve_tex_space_calc(cu);
if (cu->bb==NULL) BKE_curve_texspace_calc(cu);
bb= *(cu->bb);
for (a=0; a<8; a++) {
@@ -2298,7 +2298,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
Mesh *me= BKE_mesh_from_object(ob);
if (me) {
bb = *mesh_get_bb(ob);
bb = *BKE_mesh_boundbox_get(ob);
for (a=0; a<8; a++) {
mul_m4_v3(ob->obmat, bb.vec[a]);

View File

@@ -863,7 +863,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
mul_v3_fl(facecenter[a], 1.0f/facetotvert[a]);
/* for conversion from BU area / pixel area to reference screen size */
mesh_get_texspace(me, 0, 0, size);
BKE_mesh_texspace_get(me, 0, 0, size);
fac= ((size[0] + size[1] + size[2])/3.0f)/part->simplify_refsize;
fac= fac*fac;
@@ -3385,7 +3385,7 @@ static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float m
/* ugly hack to use non-transformed orcos, since only those
* give symmetric results for mirroring in particle mode */
if (DM_get_vert_data_layer(dm, CD_ORIGINDEX))
transform_mesh_orco_verts(ob->data, v, 3, 1);
BKE_mesh_orco_verts_transform(ob->data, v, 3, 1);
}
else {
dm->getVertCo(dm, mface->v1, v[0]);
@@ -3414,7 +3414,7 @@ void psys_mat_hair_to_orco(Object *ob, DerivedMesh *dm, short from, ParticleData
/* see psys_face_mat for why this function is called */
if (DM_get_vert_data_layer(dm, CD_ORIGINDEX))
transform_mesh_orco_verts(ob->data, &orco, 1, 1);
BKE_mesh_orco_verts_transform(ob->data, &orco, 1, 1);
copy_v3_v3(hairmat[3], orco);
}

View File

@@ -772,7 +772,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
int w, maxw;
psys_particle_on_dm(ctx->dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co1, 0, 0, 0, orco1, 0);
transform_mesh_orco_verts((Mesh*)ob->data, &orco1, 1, 1);
BKE_mesh_orco_verts_transform((Mesh*)ob->data, &orco1, 1, 1);
maxw = BLI_kdtree_find_n_nearest(ctx->tree, 3, orco1, NULL, ptn);
for (w=0; w<maxw; w++) {
@@ -895,7 +895,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
float pweight[10];
psys_particle_on_dm(dm, cfrom, cpa->num, DMCACHE_ISCHILD, cpa->fuv, cpa->foffset, co1, nor1, NULL, NULL, orco1, NULL);
transform_mesh_orco_verts((Mesh*)ob->data, &orco1, 1, 1);
BKE_mesh_orco_verts_transform((Mesh*)ob->data, &orco1, 1, 1);
maxw = BLI_kdtree_find_n_nearest(ctx->tree, 4, orco1, NULL, ptn);
maxd=ptn[maxw-1].dist;
@@ -1086,7 +1086,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
for (p=0, pa=psys->particles; p<totpart; p++, pa++) {
psys_particle_on_dm(dm, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, nor, 0, 0, orco, ornor);
transform_mesh_orco_verts((Mesh*)ob->data, &orco, 1, 1);
BKE_mesh_orco_verts_transform((Mesh*)ob->data, &orco, 1, 1);
BLI_kdtree_insert(tree, p, orco, ornor);
}
@@ -1107,7 +1107,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
}
/* we need orco for consistent distributions */
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob));
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, BKE_mesh_orco_verts_get(ob));
if (from == PART_FROM_VERT) {
MVert *mv= dm->getVertDataArray(dm, CD_MVERT);
@@ -1119,7 +1119,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
for (p=0; p<totvert; p++) {
if (orcodata) {
copy_v3_v3(co, orcodata[p]);
transform_mesh_orco_verts((Mesh*)ob->data, &co, 1, 1);
BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co, 1, 1);
}
else
copy_v3_v3(co, mv[p].co);
@@ -1166,12 +1166,12 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
copy_v3_v3(co1, orcodata[mf->v1]);
copy_v3_v3(co2, orcodata[mf->v2]);
copy_v3_v3(co3, orcodata[mf->v3]);
transform_mesh_orco_verts((Mesh*)ob->data, &co1, 1, 1);
transform_mesh_orco_verts((Mesh*)ob->data, &co2, 1, 1);
transform_mesh_orco_verts((Mesh*)ob->data, &co3, 1, 1);
BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co1, 1, 1);
BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co2, 1, 1);
BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co3, 1, 1);
if (mf->v4) {
copy_v3_v3(co4, orcodata[mf->v4]);
transform_mesh_orco_verts((Mesh*)ob->data, &co4, 1, 1);
BKE_mesh_orco_verts_transform((Mesh*)ob->data, &co4, 1, 1);
}
}
else {

View File

@@ -244,7 +244,7 @@ static void get_face_uv_map_vert(UvVertMap *vmap, struct MPoly *mpoly, struct ML
int j, nverts = mpoly[fi].totloop;
for (j = 0; j < nverts; j++) {
for (nv = v = get_uv_map_vert(vmap, ml[j].v); v; v = v->next) {
for (nv = v = BKE_mesh_uv_vert_map_get_vert(vmap, ml[j].v); v; v = v->next) {
if (v->separate)
nv = v;
if (v->f == fi)
@@ -273,7 +273,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
float uv[3] = {0.0f, 0.0f, 0.0f}; /* only first 2 values are written into */
limit[0] = limit[1] = STD_UV_CONNECT_LIMIT;
vmap = make_uv_vert_map(mpoly, mloop, mloopuv, totface, totvert, 0, limit);
vmap = BKE_mesh_uv_vert_map_make(mpoly, mloop, mloopuv, totface, totvert, 0, limit);
if (!vmap)
return 0;
@@ -281,16 +281,16 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
/* create vertices */
for (i = 0; i < totvert; i++) {
if (!get_uv_map_vert(vmap, i))
if (!BKE_mesh_uv_vert_map_get_vert(vmap, i))
continue;
for (v = get_uv_map_vert(vmap, i)->next; v; v = v->next)
for (v = BKE_mesh_uv_vert_map_get_vert(vmap, i)->next; v; v = v->next)
if (v->separate)
break;
seam = (v != NULL) || ((mvert + i)->flag & ME_VERT_MERGED);
for (v = get_uv_map_vert(vmap, i); v; v = v->next) {
for (v = BKE_mesh_uv_vert_map_get_vert(vmap, i); v; v = v->next) {
if (v->separate) {
CCGVert *ssv;
int loopid = mpoly[v->f].loopstart + v->tfindex;
@@ -358,7 +358,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
BLI_array_free(fverts);
free_uv_vert_map(vmap);
BKE_mesh_uv_vert_map_free(vmap);
ccgSubSurf_processSync(ss);
return 1;

View File

@@ -35,8 +35,8 @@
#include "BLI_pbvh.h"
#include "BKE_DerivedMesh.h"
#include "BKE_mesh.h" /* for mesh_calc_normals */
#include "BKE_global.h" /* for mesh_calc_normals */
#include "BKE_mesh.h" /* for BKE_mesh_calc_normals */
#include "BKE_global.h" /* for BKE_mesh_calc_normals */
#include "BKE_paint.h"
#include "BKE_subsurf.h"
@@ -1743,7 +1743,7 @@ void BLI_pbvh_apply_vertCos(PBVH *pbvh, float (*vertCos)[3])
}
/* coordinates are new -- normals should also be updated */
mesh_calc_normals_tessface(pbvh->verts, pbvh->totvert, pbvh->faces, pbvh->totprim, NULL);
BKE_mesh_calc_normals_tessface(pbvh->verts, pbvh->totvert, pbvh->faces, pbvh->totprim, NULL);
for (a= 0; a < pbvh->totnode; ++a)
BLI_pbvh_node_mark_update(&pbvh->nodes[a]);

View File

@@ -3809,7 +3809,7 @@ static void direct_link_mdisps(FileData *fd, int count, MDisps *mdisps, int exte
* overwritten with the correct value in
* bm_corners_to_loops() */
float gridsize = sqrtf(mdisps[i].totdisp);
mdisps[i].level = (int)(logf(gridsize - 1.0f) / M_LN2) + 1;
mdisps[i].level = (int)(logf(gridsize - 1.0f) / (float)M_LN2) + 1;
}
if ( (fd->flags & FD_FLAGS_SWITCH_ENDIAN) && (mdisps[i].disps) ) {
@@ -3908,7 +3908,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
if (mesh->mpoly) {
/* be clever and load polygons as mfaces */
mesh->totface= mesh_mpoly_to_mface(&mesh->fdata, &mesh->ldata, &mesh->pdata,
mesh->totface= BKE_mesh_mpoly_to_mface(&mesh->fdata, &mesh->ldata, &mesh->pdata,
mesh->totface, mesh->totloop, mesh->totpoly);
CustomData_free(&mesh->pdata, mesh->totpoly);
@@ -7406,7 +7406,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Curve *cu;
for (la= main->lamp.first; la; la= la->id.next) {
if (la->shadow_frustum_size == 0.0)
if (la->shadow_frustum_size == 0.0f)
la->shadow_frustum_size= 10.0f;
}

View File

@@ -2360,8 +2360,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 6)) {
Mesh *me;
for (me= main->mesh.first; me; me= me->id.next)
mesh_calc_normals_tessface(me->mvert, me->totvert, me->mface, me->totface, NULL);
for (me = main->mesh.first; me; me = me->id.next)
BKE_mesh_calc_normals_tessface(me->mvert, me->totvert, me->mface, me->totface, NULL);
}
if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 2)) {

View File

@@ -2011,10 +2011,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
for (me=main->mesh.first; me; me= me->id.next) {
if (!me->medge) {
make_edges(me, 1); /* 1 = use mface->edcode */
BKE_mesh_make_edges(me, 1); /* 1 = use mface->edcode */
}
else {
mesh_strip_loose_faces(me);
BKE_mesh_strip_loose_faces(me);
}
}

View File

@@ -1784,8 +1784,8 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
/* now fill in polys to mfaces*/
mesh->totface= mesh_mpoly_to_mface(&mesh->fdata, &backup_mesh.ldata, &backup_mesh.pdata,
mesh->totface, backup_mesh.totloop, backup_mesh.totpoly);
mesh->totface = BKE_mesh_mpoly_to_mface(&mesh->fdata, &backup_mesh.ldata, &backup_mesh.pdata,
mesh->totface, backup_mesh.totloop, backup_mesh.totpoly);
mesh_update_customdata_pointers(mesh, FALSE);

View File

@@ -737,7 +737,7 @@ void MeshImporter::bmeshConversion()
BKE_mesh_convert_mfaces_to_mpolys(me);
BKE_mesh_tessface_clear(me);
mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
BKE_mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
}
}
}
@@ -976,7 +976,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry* geom)
read_faces(mesh, me, new_tris);
make_edges(me, 0);
BKE_mesh_make_edges(me, 0);
return true;
}

View File

@@ -611,7 +611,7 @@ UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, int do_face_idx
buf = vmap->buf = (UvMapVert *)MEM_callocN(sizeof(*vmap->buf) * totuv, "UvMapVert");
if (!vmap->vert || !vmap->buf) {
free_uv_vert_map(vmap);
BKE_mesh_uv_vert_map_free(vmap);
if (do_face_idx_array)
EDBM_index_arrays_free(em);
return NULL;

View File

@@ -808,16 +808,16 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
* contain the normal of the poly the face was tessellated from. */
face_nors = CustomData_add_layer(&mesh->fdata, CD_NORMAL, CD_CALLOC, NULL, mesh->totface);
mesh_calc_normals_mapping_ex(mesh->mvert, mesh->totvert,
mesh->mloop, mesh->mpoly,
mesh->totloop, mesh->totpoly,
NULL /* polyNors_r */,
mesh->mface, mesh->totface,
polyindex, face_nors, FALSE);
BKE_mesh_calc_normals_mapping_ex(mesh->mvert, mesh->totvert,
mesh->mloop, mesh->mpoly,
mesh->totloop, mesh->totpoly,
NULL /* polyNors_r */,
mesh->mface, mesh->totface,
polyindex, face_nors, FALSE);
#else
mesh_calc_normals(mesh->mvert, mesh->totvert,
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
NULL);
BKE_mesh_calc_normals(mesh->mvert, mesh->totvert,
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
NULL);
(void)polyindex;
(void)face_nors;
#endif
@@ -1138,13 +1138,13 @@ void ED_mesh_polys_add(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_calc_normals(Mesh *mesh)
{
#ifdef USE_BMESH_MPOLY_NORMALS
mesh_calc_normals_mapping_ex(mesh->mvert, mesh->totvert,
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
NULL, NULL, 0, NULL, NULL, FALSE);
BKE_mesh_calc_normals_mapping_ex(mesh->mvert, mesh->totvert,
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
NULL, NULL, 0, NULL, NULL, FALSE);
#else
mesh_calc_normals(mesh->mvert, mesh->totvert,
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
NULL);
BKE_mesh_calc_normals(mesh->mvert, mesh->totvert,
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
NULL);
#endif
}

View File

@@ -1241,7 +1241,7 @@ static void curvetomesh(Scene *scene, Object *ob)
if (ob->disp.first == NULL)
makeDispListCurveTypes(scene, ob, 0); /* force creation */
nurbs_to_mesh(ob); /* also does users */
BKE_mesh_from_nurbs(ob); /* also does users */
if (ob->type == OB_MESH)
BKE_object_free_modifiers(ob);
@@ -1347,7 +1347,7 @@ static int convert_exec(bContext *C, wmOperator *op)
newob = ob;
}
mesh_to_curve(scene, newob);
BKE_mesh_from_curve(scene, newob);
if (newob->type == OB_CURVE)
BKE_object_free_modifiers(newob); /* after derivedmesh calls! */
@@ -1509,7 +1509,7 @@ static int convert_exec(bContext *C, wmOperator *op)
for (a = 0; a < newob->totcol; a++) id_us_plus((ID *)me->mat[a]);
}
mball_to_mesh(&baseob->disp, newob->data);
BKE_mesh_from_metaball(&baseob->disp, newob->data);
if (obact->type == OB_MBALL) {
basact = basen;

View File

@@ -749,10 +749,10 @@ static void copy_texture_space(Object *to, Object *ob)
/* pass */
}
else if (to->type == OB_MBALL) {
BKE_metaball_tex_space_calc(to);
BKE_metaball_texspace_calc(to);
}
else {
BKE_curve_tex_space_calc(to->data);
BKE_curve_texspace_calc(to->data);
}
}
@@ -1256,7 +1256,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
{
if (ob->type == OB_MESH) {
mesh_set_smooth_flag(ob, !clear);
BKE_mesh_smooth_flag_set(ob, !clear);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
@@ -1350,7 +1350,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene * scene, View3D * v3d)
space = 1.0;
if (ob->type == OB_MESH) {
float size[3];
mesh_get_texspace(ob->data, NULL, NULL, size);
BKE_mesh_texspace_get(ob->data, NULL, NULL, size);
space = size[0] / size[1];
}
else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {

View File

@@ -491,7 +491,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
}
/* update normals */
mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
BKE_mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
}
else if (ob->type == OB_ARMATURE) {
ED_armature_apply_transform(ob, mat);
@@ -772,11 +772,11 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
Mesh *me = ob->data;
if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
else if (around == V3D_CENTROID) { mesh_center_median(me, cent); }
else { mesh_center_bounds(me, cent); }
else if (around == V3D_CENTROID) { BKE_mesh_center_median(me, cent); }
else { BKE_mesh_center_bounds(me, cent); }
negate_v3_v3(cent_neg, cent);
mesh_translate(me, cent_neg, 1);
BKE_mesh_translate(me, cent_neg, 1);
tot_change++;
me->id.flag |= LIB_DOIT;

View File

@@ -328,9 +328,9 @@ static int hide_show_exec(bContext *C, wmOperator *op)
/* ensure that edges and faces get hidden as well (not used by
* sculpt but it looks wrong when entering editmode otherwise) */
if (pbvh_type == PBVH_FACES) {
mesh_flush_hidden_from_verts(me->mvert, me->mloop,
me->medge, me->totedge,
me->mpoly, me->totpoly);
BKE_mesh_flush_hidden_from_verts(me->mvert, me->mloop,
me->medge, me->totedge,
me->mpoly, me->totpoly);
}
ED_region_tag_redraw(ar);

View File

@@ -2371,7 +2371,7 @@ void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
for (a = 0; a < me->totvert; a++, mvert++)
copy_v3_v3(mvert->co, vertCos[a]);
mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
BKE_mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
}
/* apply new coords on active key block */
@@ -2604,7 +2604,7 @@ static void sculpt_flush_stroke_deform(Sculpt *sd, Object *ob)
/* Modifiers could depend on mesh normals, so we should update them/
* Note, then if sculpting happens on locked key, normals should be re-calculated
* after applying coords from keyblock on base mesh */
mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
BKE_mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
}
else if (ss->kb) {
sculpt_update_keyblock(ob);

View File

@@ -276,8 +276,8 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
if (ss->modifiers_active) {
Mesh *mesh = ob->data;
mesh_calc_normals_tessface(mesh->mvert, mesh->totvert,
mesh->mface, mesh->totface, NULL);
BKE_mesh_calc_normals_tessface(mesh->mvert, mesh->totvert,
mesh->mface, mesh->totface, NULL);
free_sculptsession_deformMats(ss);
tag_update |= 1;

View File

@@ -3599,7 +3599,7 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
finalDM->release(finalDM);
}
else {
/* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */
/* don't create boundbox here with BKE_mesh_boundbox_get(), the derived system will make it, puts deformed bb's OK */
if (me->totpoly <= 4 || ED_view3d_boundbox_clip(rv3d, ob->obmat, (ob->bb) ? ob->bb : me->bb)) {
glsl = draw_glsl_material(scene, ob, v3d, dt);
check_alpha = check_alpha_pass(base);
@@ -6153,7 +6153,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type)
BoundBox *bb = NULL;
if (ob->type == OB_MESH) {
bb = mesh_get_bb(ob);
bb = BKE_mesh_boundbox_get(ob);
}
else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
bb = ob->bb ? ob->bb : ( (Curve *)ob->data)->bb;
@@ -6187,7 +6187,7 @@ static void drawtexspace(Object *ob)
float vec[8][3], loc[3], size[3];
if (ob->type == OB_MESH) {
mesh_get_texspace(ob->data, loc, NULL, size);
BKE_mesh_texspace_get(ob->data, loc, NULL, size);
}
else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
Curve *cu = ob->data;

View File

@@ -205,7 +205,7 @@ static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
Curve *cu = (Curve*)ptr->data;
if (cu->texflag & CU_AUTOSPACE)
BKE_curve_tex_space_calc(cu);
BKE_curve_texspace_calc(cu);
}
static int rna_Curve_texspace_editable(PointerRNA *ptr)
@@ -219,7 +219,7 @@ static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values)
Curve *cu = (Curve *)ptr->data;
if (!cu->bb)
BKE_curve_tex_space_calc(cu);
BKE_curve_texspace_calc(cu);
copy_v3_v3(values, cu->loc);
}
@@ -236,7 +236,7 @@ static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
Curve *cu = (Curve *)ptr->data;
if (!cu->bb)
BKE_curve_tex_space_calc(cu);
BKE_curve_texspace_calc(cu);
copy_v3_v3(values, cu->size);
}

View File

@@ -222,7 +222,7 @@ static float rna_MeshPolygon_area_get(PointerRNA *ptr)
Mesh *me = (Mesh*)ptr->id.data;
MPoly *mp = (MPoly*)ptr->data;
return mesh_calc_poly_area(mp, me->mloop+mp->loopstart, me->mvert, NULL);
return BKE_mesh_calc_poly_area(mp, me->mloop+mp->loopstart, me->mvert, NULL);
}
static void rna_MeshTessFace_normal_get(PointerRNA *ptr, float *values)

View File

@@ -42,7 +42,7 @@
#ifdef RNA_RUNTIME
const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, bContext *C, struct Mesh *mesh2)
{
const char *ret = mesh_cmp(mesh, mesh2, FLT_EPSILON*60);
const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON*60);
if (!ret)
ret = "Same";

View File

@@ -110,9 +110,9 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
copycu->editfont = NULL;
copycu->editnurb = NULL;
nurbs_to_mesh(tmpobj);
BKE_mesh_from_nurbs(tmpobj);
/* nurbs_to_mesh changes the type to a mesh, check it worked */
/* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */
if (tmpobj->type != OB_MESH) {
BKE_libblock_free_us(&(G.main->object), tmpobj);
BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?");
@@ -136,11 +136,11 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
if (render) {
ListBase disp = {NULL, NULL};
makeDispListMBall_forRender(sce, ob, &disp);
mball_to_mesh(&disp, tmpmesh);
BKE_mesh_from_metaball(&disp, tmpmesh);
freedisplist(&disp);
}
else
mball_to_mesh(&ob->disp, tmpmesh);
BKE_mesh_from_metaball(&ob->disp, tmpmesh);
break;
}

View File

@@ -103,12 +103,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
cddm->getVertArray(cddm),
mdisps);
mesh_flush_hidden_from_verts(cddm->getVertArray(cddm),
cddm->getLoopArray(cddm),
cddm->getEdgeArray(cddm),
cddm->getNumEdges(cddm),
cddm->getPolyArray(cddm),
cddm->getNumPolys(cddm));
BKE_mesh_flush_hidden_from_verts(cddm->getVertArray(cddm),
cddm->getLoopArray(cddm),
cddm->getEdgeArray(cddm),
cddm->getNumEdges(cddm),
cddm->getPolyArray(cddm),
cddm->getNumPolys(cddm));
}
}

View File

@@ -207,7 +207,7 @@ DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float (*
}
if (orco)
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob));
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, BKE_mesh_orco_verts_get(ob));
}
else if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
dm= CDDM_from_curve(ob);

View File

@@ -325,7 +325,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
float best_dot;
/* get the untransformed face normal */
mesh_calc_poly_normal_coords(mp, mloop + mp->loopstart, (const float (*)[3])coords, face_no);
BKE_mesh_calc_poly_normal_coords(mp, mloop + mp->loopstart, (const float (*)[3])coords, face_no);
/* find the projector which the face points at most directly
* (projector normal with largest dot product is best)

View File

@@ -401,7 +401,7 @@ static void calc_edge_stress(Render *UNUSED(re), ObjectRen *obr, Mesh *me)
if (obr->totvert==0) return;
mesh_get_texspace(me, loc, NULL, size);
BKE_mesh_texspace_get(me, loc, NULL, size);
accum= MEM_callocN(2*sizeof(float)*obr->totvert, "temp accum for stress");