[Bf-blender-cvs] [8e7bbe6] master: Alembic import: fix scene min/max time computation to take objects with transform animations into account.

Kévin Dietrich noreply at git.blender.org
Wed Aug 17 22:27:30 CEST 2016


Commit: 8e7bbe66ddc402fccf05defc109e6dced74b567b
Author: Kévin Dietrich
Date:   Wed Aug 17 22:20:15 2016 +0200
Branches: master
https://developer.blender.org/rB8e7bbe66ddc402fccf05defc109e6dced74b567b

Alembic import: fix scene min/max time computation to take objects with
transform animations into account.

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

M	source/blender/alembic/intern/abc_camera.cc
M	source/blender/alembic/intern/abc_curves.cc
M	source/blender/alembic/intern/abc_mesh.cc
M	source/blender/alembic/intern/abc_nurbs.cc
M	source/blender/alembic/intern/abc_points.cc
M	source/blender/alembic/intern/abc_transform.cc
M	source/blender/alembic/intern/abc_util.h

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

diff --git a/source/blender/alembic/intern/abc_camera.cc b/source/blender/alembic/intern/abc_camera.cc
index 38a6d3d..5c34ec1 100644
--- a/source/blender/alembic/intern/abc_camera.cc
+++ b/source/blender/alembic/intern/abc_camera.cc
@@ -109,7 +109,7 @@ AbcCameraReader::AbcCameraReader(const Alembic::Abc::IObject &object, ImportSett
 	ICamera abc_cam(m_iobject, kWrapExisting);
 	m_schema = abc_cam.getSchema();
 
-	get_min_max_time(m_schema, m_min_time, m_max_time);
+	get_min_max_time(m_iobject, m_schema, m_min_time, m_max_time);
 }
 
 bool AbcCameraReader::valid() const
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc
index 4e1e4e7..2b54741 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -190,7 +190,7 @@ AbcCurveReader::AbcCurveReader(const Alembic::Abc::IObject &object, ImportSettin
 	ICurves abc_curves(object, kWrapExisting);
 	m_curves_schema = abc_curves.getSchema();
 
-	get_min_max_time(m_curves_schema, m_min_time, m_max_time);
+	get_min_max_time(m_iobject, m_curves_schema, m_min_time, m_max_time);
 }
 
 bool AbcCurveReader::valid() const
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index f1c7b6b..b80b7c0 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -968,7 +968,8 @@ AbcMeshReader::AbcMeshReader(const IObject &object, ImportSettings &settings)
 
 	IPolyMesh ipoly_mesh(m_iobject, kWrapExisting);
 	m_schema = ipoly_mesh.getSchema();
-	get_min_max_time(m_schema, m_min_time, m_max_time);
+
+	get_min_max_time(m_iobject, m_schema, m_min_time, m_max_time);
 }
 
 bool AbcMeshReader::valid() const
@@ -1120,7 +1121,8 @@ AbcSubDReader::AbcSubDReader(const IObject &object, ImportSettings &settings)
 
 	ISubD isubd_mesh(m_iobject, kWrapExisting);
 	m_schema = isubd_mesh.getSchema();
-	get_min_max_time(m_schema, m_min_time, m_max_time);
+
+	get_min_max_time(m_iobject, m_schema, m_min_time, m_max_time);
 }
 
 bool AbcSubDReader::valid() const
diff --git a/source/blender/alembic/intern/abc_nurbs.cc b/source/blender/alembic/intern/abc_nurbs.cc
index a3c18ad..4f57dfd 100644
--- a/source/blender/alembic/intern/abc_nurbs.cc
+++ b/source/blender/alembic/intern/abc_nurbs.cc
@@ -201,7 +201,7 @@ AbcNurbsReader::AbcNurbsReader(const IObject &object, ImportSettings &settings)
     : AbcObjectReader(object, settings)
 {
 	getNurbsPatches(m_iobject);
-	get_min_max_time(m_schemas[0].first, m_min_time, m_max_time);
+	get_min_max_time(m_iobject, m_schemas[0].first, m_min_time, m_max_time);
 }
 
 bool AbcNurbsReader::valid() const
diff --git a/source/blender/alembic/intern/abc_points.cc b/source/blender/alembic/intern/abc_points.cc
index fa5b71a..758d482 100644
--- a/source/blender/alembic/intern/abc_points.cc
+++ b/source/blender/alembic/intern/abc_points.cc
@@ -141,7 +141,7 @@ AbcPointsReader::AbcPointsReader(const Alembic::Abc::IObject &object, ImportSett
 {
 	IPoints ipoints(m_iobject, kWrapExisting);
 	m_schema = ipoints.getSchema();
-	get_min_max_time(m_schema, m_min_time, m_max_time);
+	get_min_max_time(m_iobject, m_schema, m_min_time, m_max_time);
 }
 
 bool AbcPointsReader::valid() const
diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc
index 3326ae0..7f8984f 100644
--- a/source/blender/alembic/intern/abc_transform.cc
+++ b/source/blender/alembic/intern/abc_transform.cc
@@ -137,7 +137,7 @@ AbcEmptyReader::AbcEmptyReader(const Alembic::Abc::IObject &object, ImportSettin
 	Alembic::AbcGeom::IXform xform(object, Alembic::AbcGeom::kWrapExisting);
 	m_schema = xform.getSchema();
 
-	get_min_max_time(m_schema, m_min_time, m_max_time);
+	get_min_max_time(m_iobject, m_schema, m_min_time, m_max_time);
 }
 
 bool AbcEmptyReader::valid() const
diff --git a/source/blender/alembic/intern/abc_util.h b/source/blender/alembic/intern/abc_util.h
index 688a25d..8cdfe21 100644
--- a/source/blender/alembic/intern/abc_util.h
+++ b/source/blender/alembic/intern/abc_util.h
@@ -64,7 +64,7 @@ void create_input_transform(const Alembic::AbcGeom::ISampleSelector &sample_sel,
                             float r_mat[4][4], float scale, bool has_alembic_parent = false);
 
 template <typename Schema>
-void get_min_max_time(const Schema &schema, chrono_t &min, chrono_t &max)
+void get_min_max_time_ex(const Schema &schema, chrono_t &min, chrono_t &max)
 {
 	const Alembic::Abc::TimeSamplingPtr &time_samp = schema.getTimeSampling();
 
@@ -81,6 +81,15 @@ void get_min_max_time(const Schema &schema, chrono_t &min, chrono_t &max)
 	}
 }
 
+template <typename Schema>
+void get_min_max_time(const Alembic::AbcGeom::IObject &object, const Schema &schema, chrono_t &min, chrono_t &max)
+{
+	get_min_max_time_ex(schema, min, max);
+
+	Alembic::AbcGeom::IXform parent(object.getParent(), Alembic::AbcGeom::kWrapExisting);
+	get_min_max_time_ex(parent.getSchema(), min, max);
+}
+
 bool has_property(const Alembic::Abc::ICompoundProperty &prop, const std::string &name);
 
 /* ************************** */




More information about the Bf-blender-cvs mailing list