Example #1
0
//-*****************************************************************************
void IPolyMeshSchema::init( const Abc::Argument &iArg0,
                            const Abc::Argument &iArg1 )
{
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "IPolyMeshSchema::init()" );

    Abc::Arguments args;
    iArg0.setInto( args );
    iArg1.setInto( args );

    AbcA::CompoundPropertyReaderPtr _this = this->getPtr();

    // no matching so we pick up old assets written as V3f
    m_positionsProperty = Abc::IP3fArrayProperty( _this, "P", kNoMatching );

    m_indicesProperty = Abc::IInt32ArrayProperty( _this, ".faceIndices",
                                        args.getSchemaInterpMatching() );
    m_countsProperty = Abc::IInt32ArrayProperty( _this, ".faceCounts",
                                       args.getSchemaInterpMatching() );

    // none of the things below here are guaranteed to exist
    if ( this->getPropertyHeader( "uv" ) != NULL )
    {
        m_uvsParam = IV2fGeomParam( _this, "uv", iArg0, iArg1 );
    }

    if ( this->getPropertyHeader( "N" ) != NULL )
    {
        m_normalsParam = IN3fGeomParam( _this, "N", iArg0, iArg1 );
    }


    IObject _thisObject = this->getParent().getObject();
    size_t numChildren = _thisObject.getNumChildren();
    for ( size_t childIndex = 0 ; childIndex < numChildren; childIndex++ )
    {
        ObjectHeader const & header = _thisObject.getChildHeader (childIndex);
        if ( IFaceSet::matches( header ) )
        {
            // start out with an empty (invalid IFaceSet)
            // accessor later on will create real IFaceSet object.
            m_faceSets [header.getName ()] = IFaceSet ();
        }
    }

    m_faceSetsLoaded = false;

    ALEMBIC_ABC_SAFE_CALL_END_RESET();
}
//-*****************************************************************************
void ISubDSchema::init( const Abc::Argument &iArg0,
                        const Abc::Argument &iArg1 )
{
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "ISubDSchema::init()" );

    Abc::Arguments args;
    iArg0.setInto( args );
    iArg1.setInto( args );

    AbcA::CompoundPropertyReaderPtr _this = this->getPtr();

    // no matching so we pick up old assets written as V3f
    m_positionsProperty = Abc::IP3fArrayProperty( _this, "P", kNoMatching );
    m_faceIndicesProperty = Abc::IInt32ArrayProperty( _this, ".faceIndices",
                            args.getSchemaInterpMatching() );
    m_faceCountsProperty = Abc::IInt32ArrayProperty( _this, ".faceCounts",
                           args.getSchemaInterpMatching() );

    m_faceVaryingInterpolateBoundaryProperty =
        Abc::IInt32Property( _this, ".faceVaryingInterpolateBoundary",
                             args.getSchemaInterpMatching() );
    m_faceVaryingPropagateCornersProperty =
        Abc::IInt32Property( _this, ".faceVaryingPropagateCorners",
                             args.getSchemaInterpMatching() );
    m_interpolateBoundaryProperty =
        Abc::IInt32Property( _this, ".interpolateBoundary",
                             args.getSchemaInterpMatching() );

    // creases, corners, and holes optionally exist
    if ( this->getPropertyHeader(".creaseIndices") != NULL)
    {
        m_creaseIndicesProperty = Abc::IInt32ArrayProperty( _this, ".creaseIndices",
                                  args.getSchemaInterpMatching() );
    }

    if ( this->getPropertyHeader(".creaseLengths") != NULL)
    {
        m_creaseLengthsProperty = Abc::IInt32ArrayProperty( _this, ".creaseLengths",
                                  args.getSchemaInterpMatching() );
    }

    if ( this->getPropertyHeader(".creaseSharpnesses") != NULL)
    {
        m_creaseSharpnessesProperty =
            Abc::IFloatArrayProperty( _this,
                                      ".creaseSharpnesses",
                                      args.getSchemaInterpMatching() );
    }

    if ( this->getPropertyHeader(".cornerIndices") != NULL)
    {
        m_cornerIndicesProperty =
            Abc::IInt32ArrayProperty( _this, ".cornerIndices",
                                      args.getSchemaInterpMatching() );
    }

    if ( this->getPropertyHeader(".cornerSharpnesses") != NULL)
    {
        m_cornerSharpnessesProperty =
            Abc::IFloatArrayProperty( _this, ".cornerSharpnesses",
                                      args.getSchemaInterpMatching() );
    }

    if ( this->getPropertyHeader(".holes") != NULL)
    {
        m_holesProperty =
            Abc::IInt32ArrayProperty( _this, ".holes",
                                      args.getSchemaInterpMatching() );
    }

    m_subdSchemeProperty = Abc::IStringProperty( _this, ".scheme",
                           args.getSchemaInterpMatching() );

    // none of the things below here are guaranteed to exist
    if ( this->getPropertyHeader( "uv" ) != NULL )
    {
        m_uvsParam = IV2fGeomParam( _this, "uv", iArg0, iArg1 );
    }

    m_faceSetsLoaded = false;

    ALEMBIC_ABC_SAFE_CALL_END_RESET();
}