Fix T49104: normal problem in imported Alembic objects

Recompute the normals if the normals are supposed to be varying (e.g. in
the ISchema).
This commit is contained in:
Kévin Dietrich 2016-08-17 23:03:34 +02:00
parent 8e7bbe66dd
commit 11e9c5e10a
Notes: blender-bot 2023-02-14 07:40:57 +01:00
Referenced by issue #49104, The normal problem in import Alembic
1 changed files with 7 additions and 3 deletions

View File

@ -936,12 +936,12 @@ static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const IObject &iobject, co
CDStreamConfig config = get_config(new_dm ? new_dm : dm);
bool has_loop_normals = false;
read_mesh_sample(&settings, schema, sample_sel, config, has_loop_normals);
bool do_normals = false;
read_mesh_sample(&settings, schema, sample_sel, config, do_normals);
if (new_dm) {
/* Check if we had ME_SMOOTH flag set to restore it. */
if (!has_loop_normals && check_smooth_poly_flag(dm)) {
if (!do_normals && check_smooth_poly_flag(dm)) {
set_smooth_poly_flag(new_dm);
}
@ -951,6 +951,10 @@ static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const IObject &iobject, co
return new_dm;
}
if (do_normals) {
CDDM_calc_normals(dm);
}
return dm;
}