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>2012-10-30 23:20:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-30 23:20:17 +0400
commit00acdb629254b680992f1863a1d62cd2985198af (patch)
treee29b23a247a6111dc47f508cab01e2a5d955b983 /source/blender/blenkernel/BKE_DerivedMesh.h
parent6bd18e357563f6b28f7cfdf6da8a032bab947172 (diff)
remove CD_POLYINDEX customdata layer:
reported as [#29376] BMESH_TODO: remove tessface CD_ORIGINDEX layer for a single mesh there could be 3 origindex mappings stored, one on the polygons and 2 on the tessfaces. (CD_POLYINDEX and CD_ORIGINDEX). as Andrew suggests, now tessfaces (which are really a cache of polygons), using origindex to point to polygons on the same derived mesh, and polygons only store the original index values.
Diffstat (limited to 'source/blender/blenkernel/BKE_DerivedMesh.h')
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 738d9101e8e..c6c54cc6e8a 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -228,6 +228,7 @@ struct DerivedMesh {
void *(*getVertData)(DerivedMesh * dm, int index, int type);
void *(*getEdgeData)(DerivedMesh * dm, int index, int type);
void *(*getTessFaceData)(DerivedMesh * dm, int index, int type);
+ void *(*getPolyData)(DerivedMesh * dm, int index, int type);
/** Return a pointer to the entire array of vert/edge/face custom data
* from the derived mesh (this gives a pointer to the actual data, not
@@ -236,7 +237,8 @@ struct DerivedMesh {
void *(*getVertDataArray)(DerivedMesh * dm, int type);
void *(*getEdgeDataArray)(DerivedMesh * dm, int type);
void *(*getTessFaceDataArray)(DerivedMesh * dm, int type);
-
+ void *(*getPolyDataArray)(DerivedMesh * dm, int type);
+
/** Retrieves the base CustomData structures for
* verts/edges/tessfaces/loops/facdes*/
CustomData *(*getVertDataLayout)(DerivedMesh * dm);
@@ -498,6 +500,7 @@ void DM_add_poly_layer(struct DerivedMesh *dm, int type, int alloctype,
void *DM_get_vert_data(struct DerivedMesh *dm, int index, int type);
void *DM_get_edge_data(struct DerivedMesh *dm, int index, int type);
void *DM_get_tessface_data(struct DerivedMesh *dm, int index, int type);
+void *DM_get_poly_data(struct DerivedMesh *dm, int index, int type);
/* custom data layer access functions
* return pointer to first data layer which matches type (a flat array)
@@ -706,4 +709,10 @@ void DM_debug_print(DerivedMesh *dm);
void DM_debug_print_cdlayers(CustomData *cdata);
#endif
+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[j] : ORIGINDEX_NONE;
+}
+
#endif