From 11e9c5e10a9914413af704d714bd1a5991112fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Wed, 17 Aug 2016 23:03:34 +0200 Subject: Fix T49104: normal problem in imported Alembic objects Recompute the normals if the normals are supposed to be varying (e.g. in the ISchema). --- source/blender/alembic/intern/alembic_capi.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc index f9364d55753..f42c708b4c2 100644 --- a/source/blender/alembic/intern/alembic_capi.cc +++ b/source/blender/alembic/intern/alembic_capi.cc @@ -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; } -- cgit v1.2.3