Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2016-08-18 00:03:34 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2016-08-18 00:03:34 +0300
commit11e9c5e10a9914413af704d714bd1a5991112fa2 (patch)
tree69010375a1f2ad2ef0f078b405e3d149b7e6b936
parent8e7bbe66ddc402fccf05defc109e6dced74b567b (diff)
Fix T49104: normal problem in imported Alembic objects
Recompute the normals if the normals are supposed to be varying (e.g. in the ISchema).
-rw-r--r--source/blender/alembic/intern/alembic_capi.cc10
1 files 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;
}