[Bf-blender-cvs] [5353418] alembic_basic_io: NURBS: fix out-of-bounds access of point weight, set default values for point properties.

Kévin Dietrich noreply at git.blender.org
Thu Jun 30 05:17:43 CEST 2016


Commit: 535341833a19c79f772b1e6a7d79a6f5c01c3be4
Author: Kévin Dietrich
Date:   Thu Jun 30 05:13:55 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB535341833a19c79f772b1e6a7d79a6f5c01c3be4

NURBS: fix out-of-bounds access of point weight, set default values for
point properties.

===================================================================

M	source/blender/alembic/intern/abc_nurbs.cc

===================================================================

diff --git a/source/blender/alembic/intern/abc_nurbs.cc b/source/blender/alembic/intern/abc_nurbs.cc
index 9c67eb3..edc98a7 100644
--- a/source/blender/alembic/intern/abc_nurbs.cc
+++ b/source/blender/alembic/intern/abc_nurbs.cc
@@ -143,7 +143,7 @@ void AbcNurbsWriter::do_write()
 
 		for (int i = 0; i < size; ++i, ++bp) {
 			copy_zup_yup(positions[i].getValue(), bp->vec);
-			weights[i] = bp->vec[4];
+			weights[i] = bp->vec[3];
 		}
 
 		ONuPatchSchema::Sample sample;
@@ -249,13 +249,15 @@ void AbcNurbsReader::readObjectData(Main *bmain, Scene *scene, float time)
 		for (int i = 0; i < num_points; ++i, ++bp) {
 			const Imath::V3f &pos_in = (*positions)[i];
 
-			if (weights && i < weights->size()) {
+			if (weights) {
 				posw_in = (*weights)[i];
 			}
 
 			copy_yup_zup(bp->vec, pos_in.getValue());
 			bp->vec[3] = posw_in;
 			bp->f1 = SELECT;
+			bp->radius = 1.0f;
+			bp->weight = 1.0f;
 		}
 
 		/* Read knots. */




More information about the Bf-blender-cvs mailing list