diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-16 20:36:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-16 20:55:14 +0300 |
commit | 595a491e63d6f3f3462675d38cfa71b4e784fe9c (patch) | |
tree | df32ec17691b9280d7b2fa675cd5e5a0f87ea849 /source/blender/editors/mesh | |
parent | c8f6313487dfbbee030c6796220cc0d91228d658 (diff) |
Add tessellation data to DerivedMesh (LoopTri)
This stores loop indices into the loop array giving easier acess
to data such as vertex-colors and UV's,
removing the need to store an MFace duplicate of custom-data.
This doesn't yet move all internal code from MFace to LoopTri just yet.
Only applies to:
- opengl drawing
- sculpting (pbvh)
- vertex/weight paint
Thanks to @psy-fi for review, fixes and improvements to drawing!
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editface.c | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index ca3c8a97d40..0017cd3c2ae 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -62,9 +62,8 @@ void paintface_flush_flags(Object *ob) Mesh *me = BKE_mesh_from_object(ob); DerivedMesh *dm = ob->derivedFinal; MPoly *polys, *mp_orig; - MFace *faces; const int *index_array = NULL; - int totface, totpoly; + int totpoly; int i; if (me == NULL) @@ -79,26 +78,7 @@ void paintface_flush_flags(Object *ob) if (dm == NULL) return; - /* - * Try to push updated mesh poly flags to three other data sets: - * - Mesh polys => Mesh tess faces - * - Mesh polys => Final derived polys - * - Final derived polys => Final derived tessfaces - */ - - if ((index_array = CustomData_get_layer(&me->fdata, CD_ORIGINDEX))) { - faces = me->mface; - totface = me->totface; - - /* loop over tessfaces */ - for (i = 0; i < totface; i++) { - if (index_array[i] != ORIGINDEX_NONE) { - /* Copy flags onto the original tessface from its original poly */ - mp_orig = me->mpoly + index_array[i]; - faces[i].flag = mp_orig->flag; - } - } - } + /* Mesh polys => Final derived polys */ if ((index_array = CustomData_get_layer(&dm->polyData, CD_ORIGINDEX))) { polys = dm->getPolyArray(dm); @@ -113,21 +93,6 @@ void paintface_flush_flags(Object *ob) } } } - - if ((index_array = CustomData_get_layer(&dm->faceData, CD_ORIGINDEX))) { - polys = dm->getPolyArray(dm); - faces = dm->getTessFaceArray(dm); - totface = dm->getNumTessFaces(dm); - - /* loop over tessfaces */ - for (i = 0; i < totface; i++) { - if (index_array[i] != ORIGINDEX_NONE) { - /* Copy flags onto the final tessface from its final poly */ - mp_orig = polys + index_array[i]; - faces[i].flag = mp_orig->flag; - } - } - } } void paintface_hide(Object *ob, const bool unselected) |