Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(534)

Unified Diff: lib/Alembic/AbcGeom/OCurves.cpp

Issue 4662068: Alembic 1.0rc1, changes since 0.9.3
Patch Set: Created 12 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Alembic/AbcGeom/OCurves.h ('k') | lib/Alembic/AbcGeom/OFaceSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Alembic/AbcGeom/OCurves.cpp
===================================================================
--- a/lib/Alembic/AbcGeom/OCurves.cpp
+++ b/lib/Alembic/AbcGeom/OCurves.cpp
@@ -72,12 +72,24 @@
}
// do we need to create uvs?
- if ( iSamp.getUVs() && !m_uvs )
+ if ( iSamp.getUVs().getVals() && !m_uvs )
{
- m_uvs = Abc::OV2fArrayProperty( this->getPtr(), "uv",
- m_positions.getTimeSampling() );
+ if ( iSamp.getUVs().getIndices() )
+ {
+ // UVs are indexed
+ m_uvs = OV2fGeomParam( this->getPtr(), "uv", true,
+ iSamp.getUVs().getScope(), 1,
+ this->getTimeSampling() );
+ }
+ else
+ {
+ // UVs are not indexed
+ m_uvs = OV2fGeomParam( this->getPtr(), "uv", false,
+ iSamp.getUVs().getScope(), 1,
+ this->getTimeSampling() );
+ }
- Abc::V2fArraySample empty;
+ OV2fGeomParam::Sample empty;
size_t numSamples = m_positions.getNumSamples();
@@ -89,12 +101,25 @@
}
// do we need to create normals?
- if ( iSamp.getNormals() && !m_normals )
+ if ( iSamp.getNormals().getVals() && !m_normals )
{
- m_normals = Abc::OV3fArrayProperty( this->getPtr(), "N",
- m_positions.getTimeSampling() );
- Abc::V3fArraySample empty;
+ if ( iSamp.getNormals().getIndices() )
+ {
+ // normals are indexed
+ m_normals = ON3fGeomParam( this->getPtr(), "N", true,
+ iSamp.getNormals().getScope(),
+ 1, this->getTimeSampling() );
+ }
+ else
+ {
+ // normals are not indexed
+ m_normals = ON3fGeomParam( this->getPtr(), "N", false,
+ iSamp.getNormals().getScope(), 1,
+ this->getTimeSampling() );
+ }
+
+ ON3fGeomParam::Sample empty;
size_t numSamples = m_positions.getNumSamples();
@@ -106,12 +131,24 @@
}
// do we need to create widths?
- if ( iSamp.getWidths() && !m_widths )
+ if ( iSamp.getWidths().getVals() && !m_widths )
{
- m_widths = Abc::OFloatArrayProperty( this->getPtr(), "width",
- m_positions.getTimeSampling() );
+ if ( iSamp.getNormals().getIndices() )
+ {
+ // normals are indexed
+ m_widths = OFloatGeomParam( this->getPtr(), "width", true,
+ iSamp.getWidths().getScope(),
+ 1, this->getTimeSampling() );
+ }
+ else
+ {
+ // normals are not indexed
+ m_widths = OFloatGeomParam( this->getPtr(), "width", false,
+ iSamp.getWidths().getScope(), 1,
+ this->getTimeSampling() );
+ }
- Abc::FloatArraySample empty;
+ OFloatGeomParam::Sample empty;
size_t numSamples = m_positions.getNumSamples();
@@ -189,13 +226,13 @@
{ SetPropUsePrevIfNull( m_childBounds, iSamp.getChildBounds() ); }
if ( m_uvs )
- { SetPropUsePrevIfNull( m_uvs, iSamp.getUVs() ); }
+ { m_uvs.set( iSamp.getUVs() ); }
if ( m_normals )
- { SetPropUsePrevIfNull( m_normals, iSamp.getNormals() ); }
+ { m_normals.set( iSamp.getNormals() ); }
if ( m_widths )
- { SetPropUsePrevIfNull( m_widths, iSamp.getWidths() ); }
+ { m_widths.set( iSamp.getWidths() ); }
// update bounds
if ( iSamp.getSelfBounds().hasVolume() )
@@ -235,7 +272,7 @@
if ( m_uvs ) { m_uvs.setFromPrevious(); }
if ( m_normals ) { m_normals.setFromPrevious(); }
if ( m_widths ) { m_widths.setFromPrevious(); }
-
+
ALEMBIC_ABC_SAFE_CALL_END();
}
@@ -252,9 +289,10 @@
m_positions = Abc::OV3fArrayProperty( _this, "P", mdata, iTsIdx );
m_selfBounds = Abc::OBox3dProperty( _this, ".selfBnds", iTsIdx );
- m_nVertices = Abc::OUInt32ArrayProperty( _this, "nVertices", iTsIdx);
+ m_nVertices = Abc::OInt32ArrayProperty( _this, "nVertices", iTsIdx);
- m_basisAndType = Abc::OScalarProperty( _this, "curveBasisAndType",
+ m_basisAndType = Abc::OScalarProperty(
+ _this, "curveBasisAndType",
AbcA::DataType( Alembic::Util::kUint8POD, 4 ), iTsIdx );
ALEMBIC_ABC_SAFE_CALL_END_RESET();
« no previous file with comments | « lib/Alembic/AbcGeom/OCurves.h ('k') | lib/Alembic/AbcGeom/OFaceSet.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b