diff options
-rw-r--r-- | source/blender/blenkernel/BKE_DerivedMesh.h | 46 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 81 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 1 |
4 files changed, 1 insertions, 130 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 69dda178c67..3fea07162a0 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -550,36 +550,6 @@ void makeDerivedMesh( struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct BMEditMesh *em, CustomDataMask dataMask, const bool build_shapekey_layers); -/** convert layers requested by a GLSL material to actually available layers in - * the DerivedMesh, with both a pointer for arrays and an offset for editmesh */ -typedef struct DMVertexAttribs { - struct { - struct MLoopUV *array; - int em_offset, gl_index, gl_texco, gl_info_index; - } tface[MAX_MTFACE]; - - struct { - struct MLoopCol *array; - int em_offset, gl_index, gl_info_index; - } mcol[MAX_MCOL]; - - struct { - float (*array)[4]; - int em_offset, gl_index, gl_info_index; - } tang[MAX_MTFACE]; - - struct { - float (*array)[3]; - int em_offset, gl_index, gl_texco, gl_info_index; - } orco; - - int tottface, totmcol, tottang, totorco; -} DMVertexAttribs; - -void DM_vertex_attributes_from_gpu( - DerivedMesh *dm, - struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs); - void DM_calc_tangents_names_from_gpu( const struct GPUVertexAttribs *gattribs, char (*tangent_names)[MAX_NAME], int *tangent_names_count); @@ -608,20 +578,4 @@ void DM_debug_print_cdlayers(CustomData *cdata); bool DM_is_valid(DerivedMesh *dm); #endif -BLI_INLINE int DM_origindex_mface_mpoly( - const int *index_mf_to_mpoly, const int *index_mp_to_orig, const int i) ATTR_NONNULL(1); - -BLI_INLINE int DM_origindex_mface_mpoly( - const int *index_mf_to_mpoly, const int *index_mp_to_orig, const int i) -{ - const int j = index_mf_to_mpoly[i]; - return (j != ORIGINDEX_NONE) ? (index_mp_to_orig ? index_mp_to_orig[j] : j) : ORIGINDEX_NONE; -} - -struct MVert *DM_get_vert_array(struct DerivedMesh *dm, bool *r_allocated); -struct MEdge *DM_get_edge_array(struct DerivedMesh *dm, bool *r_allocated); -struct MLoop *DM_get_loop_array(struct DerivedMesh *dm, bool *r_allocated); -struct MPoly *DM_get_poly_array(struct DerivedMesh *dm, bool *r_allocated); -struct MFace *DM_get_tessface_array(struct DerivedMesh *dm, bool *r_allocated); - #endif /* __BKE_DERIVEDMESH_H__ */ diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index bb4b06c1df1..9cc2bd8c152 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -521,8 +521,7 @@ void BKE_mesh_batch_cache_free(struct Mesh *me); /* Inlines */ -/* This is a copy of DM_origindex_mface_mpoly(). - * Instead of -1 that function uses ORIGINDEX_NONE as defined in BKE_customdata.h, +/* Instead of -1 that function uses ORIGINDEX_NONE as defined in BKE_customdata.h, * but I don't want to force every user of BKE_mesh.h to also include that file. * ~~ Sybren */ BLI_INLINE int BKE_mesh_origindex_mface_mpoly( diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 5a99978f00c..e4ab70e52b3 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2990,84 +2990,3 @@ bool DM_is_valid(DerivedMesh *dm) } #endif /* NDEBUG */ - -/* -------------------------------------------------------------------- */ - -MVert *DM_get_vert_array(DerivedMesh *dm, bool *allocated) -{ - CustomData *vert_data = dm->getVertDataLayout(dm); - MVert *mvert = CustomData_get_layer(vert_data, CD_MVERT); - *allocated = false; - - if (mvert == NULL) { - mvert = MEM_malloc_arrayN(dm->getNumVerts(dm), sizeof(MVert), "dmvh vert data array"); - dm->copyVertArray(dm, mvert); - *allocated = true; - } - - return mvert; -} - -MEdge *DM_get_edge_array(DerivedMesh *dm, bool *allocated) -{ - CustomData *edge_data = dm->getEdgeDataLayout(dm); - MEdge *medge = CustomData_get_layer(edge_data, CD_MEDGE); - *allocated = false; - - if (medge == NULL) { - medge = MEM_malloc_arrayN(dm->getNumEdges(dm), sizeof(MEdge), "dm medge data array"); - dm->copyEdgeArray(dm, medge); - *allocated = true; - } - - return medge; -} - -MLoop *DM_get_loop_array(DerivedMesh *dm, bool *r_allocated) -{ - CustomData *loop_data = dm->getLoopDataLayout(dm); - MLoop *mloop = CustomData_get_layer(loop_data, CD_MLOOP); - *r_allocated = false; - - if (mloop == NULL) { - mloop = MEM_malloc_arrayN(dm->getNumLoops(dm), sizeof(MLoop), "dm loop data array"); - dm->copyLoopArray(dm, mloop); - *r_allocated = true; - } - - return mloop; -} - -MPoly *DM_get_poly_array(DerivedMesh *dm, bool *r_allocated) -{ - CustomData *poly_data = dm->getPolyDataLayout(dm); - MPoly *mpoly = CustomData_get_layer(poly_data, CD_MPOLY); - *r_allocated = false; - - if (mpoly == NULL) { - mpoly = MEM_malloc_arrayN(dm->getNumPolys(dm), sizeof(MPoly), "dm poly data array"); - dm->copyPolyArray(dm, mpoly); - *r_allocated = true; - } - - return mpoly; -} - -MFace *DM_get_tessface_array(DerivedMesh *dm, bool *r_allocated) -{ - CustomData *tessface_data = dm->getTessFaceDataLayout(dm); - MFace *mface = CustomData_get_layer(tessface_data, CD_MFACE); - *r_allocated = false; - - if (mface == NULL) { - int numTessFaces = dm->getNumTessFaces(dm); - - if (numTessFaces > 0) { - mface = MEM_malloc_arrayN(numTessFaces, sizeof(MFace), "bvh mface data array"); - dm->copyTessFaceArray(dm, mface); - *r_allocated = true; - } - } - - return mface; -} diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 15c7ba54732..5c27b1b6207 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -469,7 +469,6 @@ static void bvhtree_from_mesh_verts_setup_data( data->vert = vert; data->vert_allocated = vert_allocated; - //data->face = DM_get_tessface_array(dm, &data->face_allocated); /* XXX WHY???? */ } /* Builds a bvh tree where nodes are the vertices of the given em */ |