Beispiel #1
0
void Render::outputCamera( const ScenePlug *scene, const IECore::CompoundObject *globals, IECore::Renderer *renderer ) const
{
	// get the camera from the scene
	
	const StringData *cameraPathData = globals->member<StringData>( "render:camera" );
	IECore::CameraPtr camera = 0;
	if( cameraPathData )
	{
		ScenePlug::ScenePath cameraPath;
		ScenePlug::stringToPath( cameraPathData->readable(), cameraPath );
		
		IECore::ConstCameraPtr constCamera = runTimeCast<const IECore::Camera>( scene->object( cameraPath ) );
		if( constCamera )
		{
			camera = constCamera->copy();
			const BoolData *cameraBlurData = globals->member<BoolData>( "render:cameraBlur" );
			const bool cameraBlur = cameraBlurData ? cameraBlurData->readable() : false;
			camera->setTransform( transform( scene, cameraPath, shutter( globals ), cameraBlur ) );
		}
	}
	
	if( !camera )
	{
		camera = new IECore::Camera();
	}
	
	// apply the resolution
	
	const V2iData *resolutionData = globals->member<V2iData>( "render:resolution" );
	if( resolutionData )
	{
		camera->parameters()["resolution"] = resolutionData->copy();
	}
	
	camera->addStandardParameters();
	
	// apply the shutter
	
	camera->parameters()["shutter"] = new V2fData( shutter( globals ) );
	
	// and output
	
	camera->render( renderer );
	
}
Beispiel #2
0
void outputCamera( const ScenePlug *scene, const ScenePlug::ScenePath &cameraPath, const IECore::CompoundObject *globals, IECore::Renderer *renderer )
{
	IECore::CameraPtr camera = GafferScene::camera( scene, cameraPath, globals );
	camera->render( renderer );
}