//-***************************************************************************** void OLightSchema::init( AbcA::CompoundPropertyWriterPtr iParent, const Abc::Argument &iArg0, const Abc::Argument &iArg1, const Abc::Argument &iArg2, const Abc::Argument &iArg3 ) { AbcA::TimeSamplingPtr tsPtr = Abc::GetTimeSampling( iArg0, iArg1, iArg2, iArg3 ); uint32_t tsIndex = Abc::GetTimeSamplingIndex( iArg0, iArg1, iArg2, iArg3 ); // if we specified a valid TimeSamplingPtr, use it to determine the index // otherwise we'll use the index, which defaults to the intrinsic 0 index if (tsPtr) { tsIndex = iParent->getObject()->getArchive()->addTimeSampling( *tsPtr ); m_tsPtr = tsPtr; } else { m_tsPtr = iParent->getObject()->getArchive()->getTimeSampling( tsIndex ); } }
//-***************************************************************************** AbcA::ArrayPropertyWriterPtr CpwData::createArrayProperty( AbcA::CompoundPropertyWriterPtr iParent, const std::string & iName, const AbcA::MetaData & iMetaData, const AbcA::DataType & iDataType, Util::uint32_t iTimeSamplingIndex ) { if ( m_madeProperties.count( iName ) ) { ABCA_THROW( "Already have a property named: " << iName ); } ABCA_ASSERT( iDataType.getExtent() != 0 && iDataType.getPod() != Alembic::Util::kNumPlainOldDataTypes && iDataType.getPod() != Alembic::Util::kUnknownPOD, "createArrayProperty, illegal DataType provided."); // will assert if TimeSamplingPtr not found AbcA::TimeSamplingPtr ts = iParent->getObject()->getArchive()->getTimeSampling( iTimeSamplingIndex ); PropertyHeaderPtr headerPtr( new PropertyHeaderAndFriends( iName, AbcA::kArrayProperty, iMetaData, iDataType, ts, iTimeSamplingIndex ) ); Alembic::Util::shared_ptr<ApwImpl> ret( new ApwImpl( iParent, m_group->addGroup(), headerPtr, m_propertyHeaders.size() ) ); m_propertyHeaders.push_back( headerPtr ); m_madeProperties[iName] = WeakBpwPtr( ret ); m_hashes.push_back(0); m_hashes.push_back(0); return ret; }