[Bf-blender-cvs] [b929eef8c5] master: Alembic: fixed mistake in bounding box computation

Sybren A. Stüvel noreply at git.blender.org
Fri Feb 10 12:00:23 CET 2017


Commit: b929eef8c5ead2e1ac5e3d456cb82feeba589710
Author: Sybren A. Stüvel
Date:   Fri Feb 10 11:52:14 2017 +0100
Branches: master
https://developer.blender.org/rBb929eef8c5ead2e1ac5e3d456cb82feeba589710

Alembic: fixed mistake in bounding box computation

By performing the Z-up to Y-up conversion, the change in sign of the
Z-coordinate swaps "minimum" and "maximum".

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

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

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

diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc
index 9dfccdb8c7..a5b8af542f 100644
--- a/source/blender/alembic/intern/abc_object.cc
+++ b/source/blender/alembic/intern/abc_object.cc
@@ -97,14 +97,14 @@ Imath::Box3d AbcObjectWriter::bounds()
 		return Imath::Box3d();
 	}
 
-	/* Convert Z-up to Y-up. */
+	/* Convert Z-up to Y-up. This also changes which vector goes into which min/max property. */
 	this->m_bounds.min.x = bb->vec[0][0];
 	this->m_bounds.min.y = bb->vec[0][2];
-	this->m_bounds.min.z = -bb->vec[0][1];
+	this->m_bounds.min.z = -bb->vec[6][1];
 
 	this->m_bounds.max.x = bb->vec[6][0];
 	this->m_bounds.max.y = bb->vec[6][2];
-	this->m_bounds.max.z = -bb->vec[6][1];
+	this->m_bounds.max.z = -bb->vec[0][1];
 
 	return this->m_bounds;
 }




More information about the Bf-blender-cvs mailing list