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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-04-23 17:18:11 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-04-23 17:25:12 +0400
commit70fdcebb93f0984980f7aefd33ac0fafe91f3dfe (patch)
tree3f660982693a6e1f82695a8414f81800dc8b7716 /source/blender/blenkernel/BKE_DerivedMesh.h
parent8bf7172384faf331846b6116c247992305a12e08 (diff)
Fix T39781: Autosmooth feature: erroneously showing hidden vertices' normals too when in "vertex per face" display
So, turned out after all we need a foreachmapped helper for loops as well... :/ CDDM and EBDM were reasonably simple, but I fought hours with CCGDM (subsurf) to find only a bad working solution (see D478). So I fallback to a code similar to CDDM one. Probably not nice for performances, but loops and subsurf are not matching well... Reviewers: campbellbarton CC: brecht Differential Revision: https://developer.blender.org/D478
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 a9e78b79159..60920aa1bb5 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -156,7 +156,7 @@ typedef enum DMDrawFlag {
typedef enum DMForeachFlag {
DM_FOREACH_NOP = 0,
- DM_FOREACH_USE_NORMAL = (1 << 0), /* foreachMappedVert, foreachMappedFaceCenter */
+ DM_FOREACH_USE_NORMAL = (1 << 0), /* foreachMappedVert, foreachMappedLoop, foreachMappedFaceCenter */
} DMForeachFlag;
typedef enum DMDirtyFlag {
@@ -309,6 +309,15 @@ struct DerivedMesh {
const float v0co[3], const float v1co[3]),
void *userData);
+ /** Iterate over each mapped loop in the derived mesh, calling the given function
+ * with the original loop index and the mapped loops's new coordinate and normal.
+ */
+ void (*foreachMappedLoop)(DerivedMesh *dm,
+ void (*func)(void *userData, int vertex_index, int face_index,
+ const float co[3], const float no[3]),
+ void *userData,
+ DMForeachFlag flag);
+
/** Iterate over each mapped face in the derived mesh, calling the
* given function with the original face and the mapped face's (or
* faces') center and normal.