diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-05 16:03:01 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-05 16:03:01 +0300 |
commit | 7bae9ee6b62dbc5defffb698ec3d3f39ce460254 (patch) | |
tree | 4361f69ef42814c6df54e49fe98925aca4f4cfaf /source/blender/blenkernel/intern | |
parent | e442b9916eefaea9f98c126e2390b5aafa4518cc (diff) |
Mesh validate: add an option to not clean temp/cache CDLayers.
This is mandatory for incoming custom normal imports from io scripts, because
often geometry here is corrupted, so we need to call mesh.validate() to clean it up.
Issue is, we cannot set custom normals before geometry is clean, so we need to store
temporary plain loop normals in a CD_NORMAL layer, validate, and then set custom normals.
So we need a way to prevent 'temp' lnors to be freed by validate.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_validate.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index ad316e55d85..51f17f738f0 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -3485,7 +3485,7 @@ bool DM_is_valid(DerivedMesh *dm) dm->getEdgeDataLayout(dm), dm->getLoopDataLayout(dm), dm->getPolyDataLayout(dm), - 0, /* setting mask here isn't useful, gives false positives */ + false, /* setting mask here isn't useful, gives false positives */ do_verbose, do_fixes, &changed); is_valid &= BKE_mesh_validate_arrays( diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index 3a6c949fe9c..4b2c2aba691 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -963,7 +963,7 @@ bool BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata, * * \returns true if a change is made. */ -int BKE_mesh_validate(Mesh *me, const int do_verbose) +int BKE_mesh_validate(Mesh *me, const int do_verbose, const int cddata_check_mask) { bool is_valid = true; bool changed; @@ -974,7 +974,7 @@ int BKE_mesh_validate(Mesh *me, const int do_verbose) is_valid &= BKE_mesh_validate_all_customdata( &me->vdata, &me->edata, &me->ldata, &me->pdata, - true, + cddata_check_mask, do_verbose, true, &changed); |