[Bf-blender-cvs] [e7d858b] alembic_basic_io: Compute normals if none are present in the file.
Kévin Dietrich
noreply at git.blender.org
Tue Jul 12 16:03:59 CEST 2016
Commit: e7d858b270369b3af1d2f9d9e3ab9016228dbf8e
Author: Kévin Dietrich
Date: Tue Jul 12 06:00:23 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBe7d858b270369b3af1d2f9d9e3ab9016228dbf8e
Compute normals if none are present in the file.
===================================================================
M source/blender/alembic/intern/abc_mesh.cc
M source/blender/alembic/intern/alembic_capi.cc
===================================================================
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index bba258f..401c1de 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -889,6 +889,10 @@ void AbcMeshReader::readObjectData(Main *bmain, Scene *scene, float time)
readVertexDataSample(mesh, sample.getPositions(), vertex_normals);
readPolyDataSample(mesh, sample.getFaceIndices(), sample.getFaceCounts(), poly_normals);
+
+ if (!vertex_normals && !poly_normals) {
+ BKE_mesh_calc_normals(mesh);
+ }
}
BKE_mesh_validate(mesh, false, false);
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index e8cf6e2..21c048b 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -776,6 +776,10 @@ static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const IObject &iobject, co
read_mverts(mverts, positions, vertex_normals);
read_mpolys(mpolys, mloops, mloopuvs, ldata, face_indices, face_counts, uvs, uvs_indices, poly_normals);
+ if (!vertex_normals && !poly_normals) {
+ CDDM_calc_normals(dm);
+ }
+
CDStreamConfig config;
config.user_data = dm;
config.mloop = dm->getLoopArray(dm);
More information about the Bf-blender-cvs
mailing list