diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-28 14:22:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-28 14:22:21 +0400 |
commit | 0d66b57bc278c185a721276e2fc69dad8342e76d (patch) | |
tree | d6f50f464cd9cc6bb2d7d8d2a84e588022c519e6 /source | |
parent | b0a09bfab34e0340a1c0762355043c8b41cf573e (diff) |
fix for issue reported in bug [#30381], though it doesn't deal with the crash.
calling DM_ensure_tessface() on an DM_TYPE_EDITBMESH does nothing, which is OK but was printing a warning.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 61a8ea19621..16dd722f1fc 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1900,23 +1900,37 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D CDDM_apply_vert_coords(*final_r, deformedVerts); CDDM_calc_normals(*final_r); /* was CDDM_calc_normals_mapping - campbell */ - } else if (dm) { + } + else if (dm) { *final_r = dm; (*final_r)->calcNormals(*final_r); /* BMESH_ONLY - BMESH_TODO. check if this is needed */ - } else if (!deformedVerts && cage_r && *cage_r) { + } + else if (!deformedVerts && cage_r && *cage_r) { + /* cage should already have up to date normals */ *final_r = *cage_r; (*final_r)->calcNormals(*final_r); /* BMESH_ONLY - BMESH_TODO. check if this is needed */ - } else { + } + else { + /* this is just a copy of the editmesh, no need to calc normals */ *final_r = getEditDerivedBMesh(em, ob, deformedVerts); deformedVerts = NULL; - (*final_r)->calcNormals(*final_r); /* BMESH_ONLY - BMESH_TODO. check if this is needed */ } /* --- */ /* BMESH_ONLY, ensure tessface's used for drawing, - * but dont recalculate if the last modifier in the stack gives us tessfaces */ - DM_ensure_tessface(*final_r); - if (cage_r && (*cage_r != *final_r)) DM_ensure_tessface(*cage_r); + * but dont recalculate if the last modifier in the stack gives us tessfaces + * check if the derived meshes are DM_TYPE_EDITBMESH before calling, this isnt essential + * but quiets annoying error messages since tessfaces wont be created. */ + if ((*final_r)->type != DM_TYPE_EDITBMESH) { + DM_ensure_tessface(*final_r); + } + if (cage_r) { + if ((*cage_r)->type != DM_TYPE_EDITBMESH) { + if (*cage_r != *final_r) { + DM_ensure_tessface(*cage_r); + } + } + } /* --- */ /* add an orco layer if needed */ |