void ofxAlembic::IXform::updateWithTimeInternal(double time, Imath::M44f& transform)
{
	ISampleSelector ss(time, ISampleSelector::kNearIndex);

	M44f mat;
	M44d m = m_xform.getSchema().getValue(ss).getMatrix();
	double *src = m.getValue();
	float *dst = mat.getValue();

	for (int i = 0; i < 16; i++)
		dst[i] = src[i];

	transform = mat * transform;
	
	for (int i = 0; i < 16; i++)
	{
		xform.local_matrix.getPtr()[i] = mat.getValue()[i];
		xform.global_matrix.getPtr()[i] = transform.getValue()[i];
	}
}
void MatrixMotionTransform::load( LoadContextPtr context )
{
	Transform::load( context );
	unsigned int v = m_ioVersion;

	ConstIndexedIOPtr container = context->container( staticTypeName(), v );
	container = container->subdirectory( g_snapshotsEntry );
	m_snapshots.clear();
	IndexedIO::EntryIDList names;
	container->entryIds( names, IndexedIO::Directory );
	IndexedIO::EntryIDList::const_iterator it;
	for( it=names.begin(); it!=names.end(); it++ )
	{
		ConstIndexedIOPtr snapshotContainer = container->subdirectory( *it );
		float t; snapshotContainer->read( g_timeEntry, t );
		M44f m;
		float *f = m.getValue();
		snapshotContainer->read( g_matrixEntry, f, 16 );
		m_snapshots[t] = m;
	}
}