[Bf-blender-cvs] [11e9c5e] master: Fix T49104: normal problem in imported Alembic objects
Kévin Dietrich
noreply at git.blender.org
Wed Aug 17 23:03:52 CEST 2016
Commit: 11e9c5e10a9914413af704d714bd1a5991112fa2
Author: Kévin Dietrich
Date: Wed Aug 17 23:03:34 2016 +0200
Branches: master
https://developer.blender.org/rB11e9c5e10a9914413af704d714bd1a5991112fa2
Fix T49104: normal problem in imported Alembic objects
Recompute the normals if the normals are supposed to be varying (e.g. in
the ISchema).
===================================================================
M source/blender/alembic/intern/alembic_capi.cc
===================================================================
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index f9364d5..f42c708 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;
}
More information about the Bf-blender-cvs
mailing list