示例#1
0
IECore::ConstObjectPtr SceneReader::computeObject( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	ConstSceneInterfacePtr s = scene( path );
	if( !s || !s->hasObject() )
	{
		return parent->objectPlug()->defaultValue();
	}

	return s->readObject( context->getTime() );
}
示例#2
0
IECore::ConstObjectPtr SceneReader::computeObject( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	std::string fileName = fileNamePlug()->getValue();
	if( !fileName.size() )
	{
		return parent->objectPlug()->defaultValue();
	}
	
	ConstSceneInterfacePtr s = SharedSceneInterfaces::get( fileName );
	s = s->scene( path );
	
	ObjectPtr o;
	
	if( s->hasObject() )
	{
		ConstObjectPtr o = s->readObject( context->getFrame() / g_frameRate );
		return o ? o : ConstObjectPtr( parent->objectPlug()->defaultValue() );
	}
	
	return parent->objectPlug()->defaultValue();
}