Beispiel #1
0
Imath::Box3f SceneReader::computeBound( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	ConstSceneInterfacePtr s = scene( path );
	if( !s )
	{
		return Box3f();
	}

	if( s->hasBound() )
	{
		const Box3d b = s->readBound( context->getTime() );
		if( b.isEmpty() )
		{
			return Box3f();
		}
		return Box3f( b.min, b.max );
	}
	else
	{
		return unionOfTransformedChildBounds( path, parent );
	}
}
Beispiel #2
0
void SceneReader::hashBound( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SceneNode::hashBound( path, context, parent, h );

	ConstSceneInterfacePtr s = scene( path );
	if( !s )
	{
		return;
	}

	refreshCountPlug()->hash( h );

	if( s->hasBound() )
	{
		s->hash( SceneInterface::BoundHash, context->getTime(), h );
	}
	else
	{
		fileNamePlug()->hash( h );
		h.append( &path.front(), path.size() );
	}
}