Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions contrib/IECoreAlembic/src/IECoreAlembic/PrimitiveReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ void PrimitiveReader::readArbGeomParams( const Alembic::Abc::ICompoundProperty &
IDoubleGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IV3dGeomParam::matches( header ) )
{
IV3dGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IUcharGeomParam::matches( header ) )
{
IUcharGeomParam p( params, header.getName() );
Expand Down Expand Up @@ -107,11 +102,6 @@ void PrimitiveReader::readArbGeomParams( const Alembic::Abc::ICompoundProperty &
IV2fGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IV3fGeomParam::matches( header ) )
{
IV3fGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IC3fGeomParam::matches( header ) )
{
IC3fGeomParam p( params, header.getName() );
Expand All @@ -122,14 +112,34 @@ void PrimitiveReader::readArbGeomParams( const Alembic::Abc::ICompoundProperty &
IC4fGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IP3fGeomParam::matches( header ) )
{
IP3fGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IV3fGeomParam::matches( header ) )
{
IV3fGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IN3fGeomParam::matches( header ) )
{
IN3fGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IP3fGeomParam::matches( header ) )
else if( IP3dGeomParam::matches( header ) )
{
IP3fGeomParam p( params, header.getName() );
IP3dGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IV3dGeomParam::matches( header ) )
{
IV3dGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IN3dGeomParam::matches( header ) )
{
IN3dGeomParam p( params, header.getName() );
readGeomParam( p, sampleSelector, primitive );
}
else if( IM44fGeomParam::matches( header ) )
Expand Down
37 changes: 37 additions & 0 deletions contrib/IECoreAlembic/test/IECoreAlembic/AlembicSceneTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2039,5 +2039,42 @@ def testArbGeomParamTypes( self ) :
for name in points.keys() :
self.assertEqual( points2[name], points[name] )

def testV3dVectorDataPrimitiveVariable( self ) :

points = IECoreScene.PointsPrimitive( IECore.V3fVectorData( [ imath.V3f( i ) for i in range( 0, 2 ) ] ) )

points["point"] = IECoreScene.PrimitiveVariable(
IECoreScene.PrimitiveVariable.Interpolation.Vertex,
IECore.V3dVectorData(
[ imath.V3d( i, i + 1, i + 2 ) for i in range( 0, 2 ) ],
IECore.GeometricData.Interpretation.Point
)
)
points["vector"] = IECoreScene.PrimitiveVariable(
IECoreScene.PrimitiveVariable.Interpolation.Vertex,
IECore.V3dVectorData(
[ imath.V3d( i, i * 2, i * 3 ) for i in range( 0, 2 ) ],
IECore.GeometricData.Interpretation.Vector
)
)
points["normal"] = IECoreScene.PrimitiveVariable(
IECoreScene.PrimitiveVariable.Interpolation.Vertex,
IECore.V3dVectorData(
[ imath.V3d( i, i - 1, i - 2 ) for i in range( 0, 2 ) ],
IECore.GeometricData.Interpretation.Normal
)
)

fileName = os.path.join( self.temporaryDirectory(), "doubleVector.abc" )
root = IECoreScene.SceneInterface.create( fileName, IECore.IndexedIO.OpenMode.Write )
root.createChild( "object" ).writeObject( points, 0 )
del root

root = IECoreScene.SceneInterface.create( fileName, IECore.IndexedIO.OpenMode.Read )
points2 = root.child( "object" ).readObject( 0 )
self.assertEqual( points2["point"], points["point"] )
self.assertEqual( points2["vector"], points["vector"] )
self.assertEqual( points2["normal"], points["normal"] )

if __name__ == "__main__":
unittest.main()
Loading