Пример #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();
}
Пример #2
0
//-*****************************************************************************
void ICurvesSchema::init( const Abc::Argument &iArg0,
                          const Abc::Argument &iArg1 )
{
    // Only callable by ctors (mt-safety)
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "ICurvesSchema::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,
        args.getErrorHandlerPolicy() );

    m_nVerticesProperty = Abc::IInt32ArrayProperty( _this, "nVertices",
                                                    iArg0, iArg1 );


    m_basisAndTypeProperty = Abc::IScalarProperty( _this, "curveBasisAndType",
        args.getErrorHandlerPolicy());

    // 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 );
    }

    if ( this->getPropertyHeader( "width" ) != NULL )
    {
        m_widthsParam = IFloatGeomParam( _this, "width", iArg0, iArg1 );
    }

    if ( this->getPropertyHeader( ".velocities" ) != NULL )
    {
        m_velocitiesProperty = Abc::IV3fArrayProperty( _this, ".velocities",
                                               iArg0, iArg1 );
    }

    ALEMBIC_ABC_SAFE_CALL_END_RESET();
}
Пример #3
0
//-*****************************************************************************
void INuPatchSchema::init( const Abc::Argument &iArg0,
                           const Abc::Argument &iArg1 )
{
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "INuPatchSchema::init()" );

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

    m_hasTrimCurve = false;

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

    // required properties

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

    m_numUProperty = Abc::IInt32Property( _this, "nu", iArg0, iArg1 );

    m_numVProperty = Abc::IInt32Property( _this, "nv", iArg0, iArg1 );

    m_uOrderProperty = Abc::IInt32Property( _this, "uOrder", iArg0, iArg1 );

    m_vOrderProperty = Abc::IInt32Property( _this, "vOrder", iArg0, iArg1 );

    m_uKnotProperty = Abc::IFloatArrayProperty( _this, "uKnot", iArg0, iArg1 );

    m_vKnotProperty = Abc::IFloatArrayProperty( _this, "vKnot", iArg0, iArg1 );

    // optional properties
    // none of the things below here are guaranteed to exist

    if ( this->getPropertyHeader( "w" ) != NULL )
    {
        m_positionWeightsProperty = Abc::IFloatArrayProperty( _this, "w",
            iArg0, iArg1 );
    }

    if ( this->getPropertyHeader( ".velocities" ) != NULL )
    {
        m_velocitiesProperty = Abc::IV3fArrayProperty( _this, ".velocities",
            iArg0, iArg1 );
    }

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

    if ( this->getPropertyHeader( "uv" ) != NULL )
    {
        m_uvsParam = IV2fGeomParam( _this, "uv", iArg0, iArg1 );
    }

    if ( this->hasTrimProps() )
    {
        m_trimNumLoopsProperty = Abc::IInt32Property( _this, "trim_nloops",
                                                      iArg0, iArg1 );
        m_trimNumCurvesProperty = Abc::IInt32ArrayProperty(
            _this, "trim_ncurves", iArg0, iArg1 );
        m_trimNumVerticesProperty = Abc::IInt32ArrayProperty(
            _this, "trim_n", iArg0, iArg1 );
        m_trimOrderProperty = Abc::IInt32ArrayProperty( _this, "trim_order",
                                                        iArg0, iArg1 );
        m_trimKnotProperty = Abc::IFloatArrayProperty( _this, "trim_knot",
                                                       iArg0, iArg1 );
        m_trimMinProperty = Abc::IFloatArrayProperty( _this, "trim_min",
                                                      iArg0, iArg1 );
        m_trimMaxProperty = Abc::IFloatArrayProperty( _this, "trim_max",
                                                      iArg0, iArg1 );
        m_trimUProperty = Abc::IFloatArrayProperty( _this, "trim_u",
                                                    iArg0, iArg1 );
        m_trimVProperty = Abc::IFloatArrayProperty( _this, "trim_v",
                                                    iArg0, iArg1 );
        m_trimWProperty = Abc::IFloatArrayProperty( _this, "trim_w",
                                                    iArg0, iArg1 );

        m_hasTrimCurve = m_trimNumLoopsProperty.getNumSamples() > 0;
    }

    ALEMBIC_ABC_SAFE_CALL_END_RESET();
}