Пример #1
0
//-*****************************************************************************
void AddArbitraryStringPropertyToParamListBuilder(
    ICompoundProperty &parent,
    const PropertyHeader &propHeader,
    ISampleSelector &sampleSelector,
    ParamListBuilder &ParamListBuilder
                                                 )
{
    IStringArrayProperty prop( parent, propHeader.getName() );
    if ( ! prop.valid() )
    {
        //error message?
        return;
    }

    std::string rmanType = GetPrmanScopeString(
        GetGeometryScope( propHeader.getMetaData() ) ) + " ";
    rmanType += "string " + propHeader.getName();

    StringArraySamplePtr propSample = prop.getValue( sampleSelector );

    RtPointer dataStart = NULL;
    for ( size_t i = 0; i < propSample->size(); ++i )
    {
        RtPointer data = ParamListBuilder.addStringValue( (*propSample)[i] );
        if ( i == 0 ) { dataStart = data; }
    }

    ParamListBuilder.add(rmanType, dataStart, propSample);

}
Пример #2
0
void AddArbitraryPropertyToParamListBuilder( ICompoundProperty & parent,
                                             const PropertyHeader &propHeader,
                                             ISampleSelector &sampleSelector,
                                             const std::string &rmanBaseType,
                                             ParamListBuilder &ParamListBuilder
                                           )
{
    T prop( parent, propHeader.getName() );

    if ( ! prop.valid() )
    {
        //TODO error message?
        return;
    }

    std::string rmanType = GetPrmanScopeString(
        GetGeometryScope( propHeader.getMetaData() ) ) + " ";

    rmanType += rmanBaseType + " " + propHeader.getName();

    typename T::sample_ptr_type propSample = prop.getValue( sampleSelector );

    ParamListBuilder.add( rmanType, (RtPointer)propSample->get(), propSample );
}