Alembic: only interpolate vertices when their number don't differ
authorKévin Dietrich <kevin.dietrich@mailoo.org>
Sun, 25 Sep 2016 20:09:05 +0000 (22:09 +0200)
committerKévin Dietrich <kevin.dietrich@mailoo.org>
Sun, 25 Sep 2016 20:11:37 +0000 (22:11 +0200)
between samples.

This could cause some crashes.

source/blender/alembic/intern/abc_mesh.cc

index 00c867799608f262d78040ff0fc15300f227eefe..8e640b36c2779645b2c83b278ea115829c01afee 100644 (file)
@@ -859,7 +859,10 @@ static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data)
        const P3fArraySamplePtr &positions = mesh_data.positions;
        const N3fArraySamplePtr &normals = mesh_data.vertex_normals;
 
-       if (config.weight != 0.0f && mesh_data.ceil_positions) {
+       if (   config.weight != 0.0f
+           && mesh_data.ceil_positions != NULL
+           && mesh_data.ceil_positions->size() == positions->size())
+       {
                read_mverts_interp(mverts, positions, mesh_data.ceil_positions, config.weight);
                return;
        }