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>2013-05-30 22:09:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-30 22:09:19 +0400
commitd7f51f83f65799b447324d1738239cffdc5e1918 (patch)
treea050f6d3cc5ee87565bb5e56650a99bbaf411081 /source/blender/blenkernel/intern/DerivedMesh.c
parent09e11ad6ef1187d581b64a9ac6ebbbb6f056f7d9 (diff)
remove CD_MASK_NORMAL from CD_MASK_DERIVEDMESH, bmesh merge included this but its not needed.
Now add asserts to make sure this layer is only added once the modifier stack has been calculated. this saves normal layer being calculated whenver vertex normals need updating.
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 4a5aaa65f90..fc5b91a93cc 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -843,6 +843,8 @@ static DerivedMesh *modwrap_applyModifier(
ModifierApplyFlag flag)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
+ BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
+
if (mti->dependsOnNormals && mti->dependsOnNormals(md)) {
DM_ensure_normals(dm);
}
@@ -856,6 +858,8 @@ static DerivedMesh *modwrap_applyModifierEM(
ModifierApplyFlag flag)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
+ BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
+
if (mti->dependsOnNormals && mti->dependsOnNormals(md)) {
DM_ensure_normals(dm);
}
@@ -869,6 +873,8 @@ static void modwrap_deformVerts(
ModifierApplyFlag flag)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
+ BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
+
if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
DM_ensure_normals(dm);
}
@@ -881,6 +887,8 @@ static void modwrap_deformVertsEM(
float (*vertexCos)[3], int numVerts)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
+ BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
+
if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
DM_ensure_normals(dm);
}
@@ -1437,6 +1445,9 @@ static void add_shapekey_layers(DerivedMesh *dm, Mesh *me, Object *UNUSED(ob))
*/
static void dm_ensure_display_normals(DerivedMesh *dm)
{
+ /* this is for final output only, up until now this layer should be missing */
+ BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
+
if ((dm->type == DM_TYPE_CDDM) &&
((dm->dirty & DM_DIRTY_NORMALS) || CustomData_has_layer(&dm->faceData, CD_NORMAL) == FALSE))
{