diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-20 13:37:51 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-20 16:53:41 +0300 |
commit | 1ee8c3e46a7ab199750373b53050e9b54c5ac9cc (patch) | |
tree | 3043625380d4cc3758662664f6380a580f0b09ee /source | |
parent | 88d634ca0517c26cefaf9f4212e32c59e3d995f1 (diff) |
Modifier stack: Use evaluated mesh to check normals
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 1d787388774..0fc1270ff0b 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1990,6 +1990,14 @@ static void mesh_build_extra_data(struct Depsgraph *depsgraph, Object *ob) } } +static void mesh_runtime_check_normals_valid(const Mesh* mesh) +{ + UNUSED_VARS_NDEBUG(mesh); + BLI_assert(!(mesh->runtime.cd_dirty_vert & CD_MASK_NORMAL)); + BLI_assert(!(mesh->runtime.cd_dirty_loop & CD_MASK_NORMAL)); + BLI_assert(!(mesh->runtime.cd_dirty_poly & CD_MASK_NORMAL)); +} + static void mesh_build_data( struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask, const bool build_shapekey_layers, const bool need_mapping) @@ -2025,8 +2033,7 @@ static void mesh_build_data( // BKE_sculpt_update_mesh_elements(depsgraph, scene, scene->toolsettings->sculpt, ob, false, false); } - BLI_assert(!(ob->derivedFinal->dirty & DM_DIRTY_NORMALS)); - + mesh_runtime_check_normals_valid(ob->runtime.mesh_eval); mesh_build_extra_data(depsgraph, ob); } @@ -2053,7 +2060,7 @@ static void editbmesh_build_data( em->lastDataMask = dataMask; - BLI_assert(!(em->mesh_eval_final->runtime.cd_dirty_vert & DM_DIRTY_NORMALS)); + mesh_runtime_check_normals_valid(em->mesh_eval_final); } static CustomDataMask object_get_datamask(const Depsgraph *depsgraph, Object *ob, bool *r_need_mapping) |