Render API

enum LiveRenderFilterMode

Values:

enumerator kLiveRenderFilterMode_Append
enumerator kLiveRenderFilterMode_Replace
enum SceneGraphTraversalMode

Values:

enumerator kSceneGraphTraversalMode_LocationOrigin
enumerator kSceneGraphTraversalMode_RecursiveFromSelection
enumerator kSceneGraphTraversalMode_SelectedLocations
enumerator kSceneGraphTraversalMode_SelectedLocationsRecursive
enum ProceduralArgsType

Values:

enumerator kProceduralArgsType_Classic
enumerator kProceduralArgsType_ScenegraphAttr
std::string buildProceduralArgsString(FnScenegraphIterator sgIterator, ProceduralArgsType type, const std::string &argsAttrName, const ProceduralOutputContextInfo &contextInfo)
void flushProceduralDsoCaches(const std::string &apiName = "")

flushProceduralDsoCaches

int getPixelAreaThroughCamera(FnScenegraphIterator sgIterator, const std::string &cameraName, const std::string &resolution)

getPixelAreaThroughCamera

void findSampleTimesRelevantToShutterRange(std::vector<float> &sampleTimes, const std::set<float> &inputSamples, float shutterOpen, float shutterClose)

findSampleTimesRelevantToShutterRange

std::string getRenderResolution(FnScenegraphIterator rootIterator, int *width, int *height)

getRenderResolution

std::string getCameraPath(FnScenegraphIterator rootIterator)

getCameraPath

void fillXFormListForLocation(std::vector<Transform> &xFormList, FnScenegraphIterator sgIterator, float shutterClose = 0.0f)

fillXFormListForLocation

bool fillXFormListFromAttributes(std::vector<Transform> &xFormList, const FnAttribute::GroupAttribute &xformAttr, float shutterClose = 0.0f, bool invertMatrix = true)

fillXFormListFromAttributes

FnAttribute::GroupAttribute convertTexturesToArbitraryAttr(const FnAttribute::GroupAttribute &texturesAttr)

convertTexturesToArbitraryAttr

FnAttribute::GroupAttribute getFlattenedMaterialAttr(FnScenegraphIterator sgIterator, const FnAttribute::StringAttribute &terminalNamesAttr)

getFlattenedMaterialAttr

void emptyFlattenedMaterialCache()

emptyFlattenedMaterialCache

CameraInfo getCameraInfo(FnScenegraphIterator sgIterator, const std::string &cameraInfoPath)

getCameraInfo

bool processLocation(FnScenegraphIterator sgIterator, const std::string &rendererName, const std::string &locationName, void *optionalInput, void **optionalOutput)

Process a scene graph location for given a location type and renderer name. Looks up a scene graph location delegate plug-in given a location type and renderer name. If a plug-in is found the rendering/processing for this location is delegated to the plug-in where it operates on the corresponding scene graph iterator.

Parameters:
  • sgIterator – A scene graph iterator for the location to process.

  • rendererName – The name of the processor/renderer that should be used (can be empty to signify any-renderer).

  • locationName – The location type as retrieved from Foundry::Katana::SceneGraphIterator::getType() (must not empty).

  • optionalInput – Optional input data for the plug-in.

  • optionalOutput – Optional pointer that will point to the result of the processing/rendering.

Returns:

true if a plug-in is found, false otherwise.

void fillDelegateHandledLocationTypesList(std::vector<std::string> &delegateHandledLocationTypesList, const std::string &renderer = std::string())

Returns a vector containing the location types for which there are registered ScenegraphLocationDelegate plugins. Specifying an empty string for the renderer forces a search for location types with ScenegraphLocationDelegate plugins for any renderer.

Parameters:
  • delegateHandledLocationTypesList – a reference to a vector that will be filled with location type names; one for each location type that is handled by a registered delegate.

  • renderer – The renderer name, can be empty to denote any-renderer

std::string buildTempRenderLocation(FnScenegraphIterator sgIterator, const std::string &outputName, const std::string &prefix, const std::string &fileExtension, const float frameTime)

Build a render location in the temporary directory for a render output.

Parameters:
  • sgIterator – The root scene graph iterator

  • outputName – The name of the render output

  • prefix – The filename prefix

  • fileExtension – The filename extension

  • frameTime – The current frame time

Returns:

The built temporary location for the render output

std::string buildTileLocation(FnScenegraphIterator sgIterator, const std::string &outputPath)

Build a tile location from the render settings for a given output path.

Parameters:
  • sgIterator – The root scene graph iterator

  • outputPath – The output path for the built tile filename

Returns:

The location to a tile location which consists of the output path and the built tile filename using the tile render settings

class CameraSettings
#include <CameraSettings.h>

A utility class which provides Katana’s camera settings by parsing attribute data on camera scene graph locations. This class can be extended if renderer specific processing is required.

Note

Where applicable, the getter functions refer to the camera settings attribute on the camera scene graph location.

Public Types

typedef std::shared_ptr<CameraSettings> Ptr

Public Functions

inline CameraSettings(Foundry::Katana::FnScenegraphIterator iterator, const std::string &cameraName = "")
Parameters:
  • iterator – The root scene graph iterator

  • cameraName – The camera scene graph location name (/root/cam/[cameraName])

inline virtual ~CameraSettings()
virtual int initialise(int displayWindow[4], int overscan[4], float shutterClose = 0.0f)

Handles the camera attribute parsing

Parameters:
  • displayWindow – The display window (affects the camera’s screen window)

  • overscan – The overscan (affects the camera’s screen window)

  • shutterClose – Shutter close (used to calculate the camera’s transforms)

Returns:

A zero value if successful, a non-zero value otherwise

inline std::string getName() const
Returns:

The camera’s scene graph location name.

inline std::string getProjection() const
Returns:

The camera’s projection, e.g. ‘perspective’ (geometry.projection)

inline float getFov() const
Returns:

The camera’s field of view (geometry.fov)

void getClipping(float clipping[2]) const
Parameters:

clipping[out] The camera’s clipping plane (near, far) (geometry.near and geometry.far).

void getScreenWindow(float screenWindow[4]) const
Parameters:

screenWindow[out] The camera’s screen window (left, right, bottom, top).

inline std::vector<FnRenderOutputUtils::RenderOutputUtils::Transform> getTransforms() const
Returns:

The camera’s transform (inverse xform attribute list)

Protected Attributes

Foundry::Katana::FnScenegraphIterator _iterator
std::string _cameraName
std::string _projection
float _fov
float _orthographicWidth
float _clipping[2]
float _screenWindow[4]
std::vector<FnRenderOutputUtils::RenderOutputUtils::Transform> _transforms
class CopyAndConvertRenderAction : public Foundry::Katana::Render::CopyRenderAction
#include <CopyAndConvertRenderAction.h>

A render action which renders to a temporary location and then performs a conversion based on the input parameters which include convert settings attributes. The converted file is then copied to the target location.

Note

The temporary file is deleted unless the KATANA_KEEP_TEMP_RENDER_FILES environment variable is set.

Public Functions

CopyAndConvertRenderAction(const std::string &renderTargetLocation, const std::string &tempRenderLocation, bool clampOutput, bool colorConvert, const std::string &computeStats, const RenderSettings::AttributeSettings &convertSettings)
Parameters:
  • renderTargetLocation – The file location which is read and displayed in the monitor.

  • tempRenderLocation – The file location which is rendered to and then copied to the target location.

  • clampOutput – Post-render, clamp negative rgb values to 0, and clamp alpha values to 0-1.

  • colorConvert – Post-render, convert rendered image data from linear to output colorspace specified in the filename.

  • computeStats – Specifies whether and how to compute image statistics as a post process, appending as exr metadata. The default value is ‘None’.

  • convertSettings – exr conversion settings which include compression, bit depth, type, and an optimisation flag.

inline virtual ~CopyAndConvertRenderAction()
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const
void setAdditionalExrAttrs(const RenderSettings::AttributeSettings &additionalExrAttrs)
void setOffsetForOverscan(bool value)

Protected Attributes

bool _clampOutput
bool _colorConvert
std::string _computeStats
RenderSettings::AttributeSettings _convertSettings
RenderSettings::AttributeSettings _additionalExrAttrs
bool _offsetForOverscan
class CopyRenderAction : public Foundry::Katana::Render::RenderAction
#include <CopyRenderAction.h>

A render action which renders to a temporary location and then copies the rendered file to the target location.

Note

The temporary file is deleted unless the KATANA_KEEP_TEMP_RENDER_FILES environment variable is set.

Subclassed by Foundry::Katana::Render::CopyAndConvertRenderAction, Foundry::Katana::Render::PostCommandsRenderAction

Public Functions

CopyRenderAction(const std::string &renderTargetLocation, const std::string &tempRenderLocation)
Parameters:
  • renderTargetLocation – The file location which read and displayed in the monitor.

  • tempRenderLocation – The file location which is rendered to and then copied to the target location.

inline virtual ~CopyRenderAction()
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const

Protected Attributes

std::string _tempRenderLocation
class DiskRenderOutputProcess
#include <DiskRenderOutputProcess.h>

Configures the render process for disk renders and defines how render outputs are managed.

Public Types

typedef FnPlatform::internal::UniquePtr<RenderAction> UniquePtr
typedef UniquePtr::type RenderActionPtr

Public Functions

DiskRenderOutputProcess()
inline virtual ~DiskRenderOutputProcess()
void setRenderAction(RenderActionPtr renderAction)

A render action declares where the outputs are rendered to and how they are handled after the render is complete. All stages of the render action are executed before the post-render commands.

Parameters:

renderAction – The render action used for this render output process.

void addPreCommand(const std::string &command)

Add a command line which is executed before the render.

Parameters:

command – Pre-render command line

void addPostCommand(const std::string &command)

Add a command line which is executed after the render. The post-render commands are always executed after all the stages of a render action but before temporary files are cleaned up.

Parameters:

command – Post-render command line

FnAttribute::GroupAttribute buildRenderOutputAttribute() const
class GlobalSettings
#include <GlobalSettings.h>

A utility class which provides a renderer’s global settings from the Katana recipe if they are used. The attributes can be found on the root scene graph location at [rendererName]GlobalStatements. This class is a placeholder and can be extended to provide renderer specific parsing and access functions.

Public Functions

GlobalSettings(FnScenegraphIterator rootIterator, const std::string &rendererNamespace)
Parameters:
  • rootIterator – The root scene graph iterator

  • rendererNamespace – The namespace used (typically the renderer name) to define the global settings group attribute for the renderer ([rendererNamespace]GlobalStatements).

inline virtual ~GlobalSettings()
virtual int initialise(const std::string &rendererNamespace)

Parses the the global settings attributes

Parameters:

rendererNamespace – The namespace used (typically the renderer name) to define the global settings group attribute for the renderer ([rendererNamespace]GlobalStatements).

Returns:

A zero value if successful, a non-zero value otherwise

inline GroupAttribute getGlobalSettingsAttr() const
Returns:

The group attribute containing the global settings ([rendererNamespace]GlobalStatements)

inline Attribute getAttribute(const std::string &attributeName) const

Finds an Attribute under the global settings by name

Parameters:

attributeName – The name of a global settings attribute

Returns:

The named Attribute if found ([rendererNamespace]GlobalStatements.[attributeName])

Protected Attributes

FnScenegraphIterator _rootIterator
GroupAttribute _globalSettingsAttr
class IdSenderInterface
#include <IdSenderInterface.h>

An interface for sending (ID, scene graph location name) pairs to Katana. This mapping is then used by the color picker to map a picked ID value in the monitor to the name of the corresponding scene graph location.

Subclassed by Foundry::Katana::Render::SocketIdSender

Public Functions

inline virtual ~IdSenderInterface()
virtual void getIds(int64_t *nextId, int64_t *maxId) = 0

Get the next unique ID integer value and the maximum number of IDs.

This function is now deprecated and shouldn’t be called. For backwards compatibility, this function will still return the legacy values nextId = 1 and maxId = 1000000.

Now valid IDs range from 1 to 18446744073709551615. Value 0 is reserved.

Parameters:
  • nextId – A unique incremented ID value

  • maxId – The maximum number of ID values

virtual void send(uint64_t id, const char *const objectName) = 0

Send an ID and scene graph location name pair for a rendered object to Katana.

Now valid IDs range from 1 to 18446744073709551615. Value 0 is reserved.

Parameters:
  • id – Unique ID

  • objectName – Scene graph location name

class NoOutputRenderAction : public Foundry::Katana::Render::RenderAction
#include <NoOutputRenderAction.h>

A render action which does not specify any output locations.

Public Functions

NoOutputRenderAction()
inline virtual ~NoOutputRenderAction()
class PostCommandsRenderAction : public Foundry::Katana::Render::CopyRenderAction
#include <PostCommandsRenderAction.h>

A render action which renders to a temporary location and then runs post commands to process image and copy to target render location.

Note

The temporary file is deleted unless the KATANA_KEEP_TEMP_RENDER_FILES environment variable is set.

Public Functions

PostCommandsRenderAction(const std::string &renderTargetLocation, const std::string &tempRenderLocation, const std::vector<std::string> &postCommands)
Parameters:
  • renderTargetLocation – The file location which is read and displayed in the monitor.

  • tempRenderLocation – The file location which is rendered to and then copied to the target location.

  • postCommands – The external commands to run to convert tempRenderLocation to renderTargetLocation.

inline virtual ~PostCommandsRenderAction()
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const
void addCleanupFile(const std::string &cleanupFile)

Protected Attributes

std::vector<std::string> _postCommands
std::vector<std::string> _cleanupFiles
class RenderAction
#include <RenderAction.h>

A render action which renders directly to the target location.

Subclassed by Foundry::Katana::Render::CopyRenderAction, Foundry::Katana::Render::NoOutputRenderAction, Foundry::Katana::Render::TemporaryRenderAction

Public Functions

RenderAction(const std::string &renderTargetLocation)
Parameters:

renderTargetLocation – The file location which is rendered to and then displayed in the monitor.

inline virtual ~RenderAction()
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const
void setRenderTargetLocation(const std::string &renderTargetLocation)

Set the target location of the file which will be rendered to. The rendered file will be read and displayed in the catalog and monitor unless setLoadOutputInMonitor is set to false.

Parameters:

renderTargetLocation – The file location which is rendered to and then displayed in the monitor.

void setLoadOutputInMonitor(bool loadOutputInMonitor)

The rendered output is loaded into the monitor and catalog by default unless it is disabled with this function (does not apply to batch rendering).

Parameters:

loadOutputInMonitor – Specifies whether or not the render output should be loaded in the monitor

void setForceOverwriteTarget(bool forceOverwriteTarget)

The rendered output overwrites the target file (even if it is set read-only) unless it is disabled with this function.

Parameters:

forceOverwriteTarget – Specifies whether or not the render output should forcibly overwrite any existing file. Default is true. If set to false, render will fail if target file is read-only.

void setCreateDestinationDirectories(bool createDestinationDirectories)

The rendered output creates any necessary directories required to satisfy the path specified for the final render location, unless this feature is disabled with this function.

Parameters:

createDestinationDirectories – Specifies whether or not the render output should create directories if the destination path does not exist. Default is true. If set to false, render will fail if target path doesn’t exist.

Protected Attributes

std::string _renderTargetLocation
bool _loadOutputInMonitor
bool _forceOverwriteTarget
bool _createDestinationDirectories
class RenderBase
#include <RenderBase.h>

The base class for the render plug-in which takes a Katana recipe and converts it into the renderer’s language.

A render plug-in represents a single render process (for a single frame) where the plug-in is instantiated when a render is launched and destroyed when the render is complete or cancelled. The Katana recipe is presented to the render plug-in in the form of a FnScenegraphIterator which allows traversing the scene graph in a deferred manner. The root scene graph iterator is passed to the plug-in’s constructor where it is accessible anywhere in the plug-in through Render::RenderBase::getRootIterator. The render arguments are also passed to the constructor but we recommend using the wrapper functions to retrieve the standard arguments.

The plug-in has to extend the Render abstract class and register itself using the DEFINE_RENDER_PLUGIN(class) and REGISTER_PLUGIN(class, name, major_version, minor_version) macros. This will ensure the plug-in is exposed in the UI by its registered name as well as making it available to Katana’s render process.

Public Functions

inline RenderBase(Foundry::Katana::FnScenegraphIterator rootIterator, FnAttribute::GroupAttribute arguments)

The render plug-in class is instantiated by the renderboot process which is launched when a render is started through the UI or using the RenderManager.StartRender script function.

Parameters:
  • rootIterator – The root FnScenegraphIterator used to traverse the scene graph produced by a Katana recipe

  • arguments – Render arguments (e.g. render time)

inline virtual ~RenderBase()
inline virtual int setup()

Set up the render plug-in so that it is ready to perform one or more renders.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int cleanup()

Clean up any resources that the render plug-in has allocated.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual void setRootIterator(Foundry::Katana::FnScenegraphIterator rootIterator)

Set the root FnScenegraphIterator to use to traverse the Katana scene graph to the given scene graph iterator.

Parameters:

rootIterator – The root FnScenegraphIterator to use.

virtual int start() = 0

Start a render by traversing the scene graph using FnScenegraphIterator and interpret the locations and attributes into the renderer’s language. This function is called at the start of each frame to be rendered. It is possible that this will be called multiple times during the lifetime of the plug-in.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int pause()

Interrupt and pause the render process but does not terminate it.

Note

This is only used during live render when updating regions of interest.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int resume()

Resume a paused render.

Note

This is currently never called.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int stop()

Called at the end of each frame that is rendered. It is possible that this will be called multiple times during the lifetime of the plug-in.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int startLiveEditing()

Start the live render process. Data updates and control commands will follow.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int stopLiveEditing()

Stop the live render process. No further data updates or control commands should be expected.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int processControlCommand(const std::string &command)

Process a custom live render control command which has been triggered by the user in the live update tab.

Parameters:

command – Live render control command

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int queueDataUpdates(FnAttribute::GroupAttribute updateAttribute)

Process a data update during live render. The update is based on an attribute convention where an update for a single scene graph location is encapsulated by a GroupAttribute. Each attribute update contains the following:

  • type: root, globals, camera, light, geoMaterial, or a custom type declared as a LiveRenderAPI plugin.

  • location: The full scene graph location name

  • attributes: A GroupAttribute containing the update attributes which vary based on the type:

    • root: camera (StringAttribute containing the selected camera)

    • globals: [rendererName]GlobalStatements

    • camera: xform, geometry

    • light: xform, material, geometry, mute, info

    • geoMaterial: material, info

    • (custom): Depends on what attributes were declared for the custom type.

Note

A useful trick while debugging is to print the XML string for the update attribute to see its contents: updateAttribute.getXML();

Note

This function is called from a separate update thread whereas hasPendingDataUpdates and applyPendingDataUpdates are called in the main render process thread.

Parameters:

updateAttribute – A group attribute containing one or more update attributes.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual int applyPendingDataUpdates()

Apply one or more live data updates which have been processed by queueDataUpdates. This provides an opportunity to process and queue live update attributes in the update thread and then flush them in the main thread.

This function is called if hasPendingDataUpdates returns true.

Returns:

A zero value if successful, a non-zero value otherwise.

inline virtual bool hasPendingDataUpdates() const

Inform the render process whether it has to flush and apply live updates.

Returns:

true if there are updates which have to be applied, false otherwise

inline virtual void configureDiskRenderOutputProcess(DiskRenderOutputProcess &diskRenderOutputProcess, const std::string &outputName, const std::string &outputPath, const std::string &renderMethodName, const float &frameTime) const

Provide Katana with information on how to process a given render output which has been defined in a Katana scene using the RenderOutputDefine node. This is only applicable during disk render where the function is called for each render output (port) on the render node.

Note

The list of available output types is provided by RendererInfo::RendererInfoBase::buildRendererObjectInfo when Katana calls the function using kFnRendererObjectTypeRenderOutput as an object type.

Parameters:
  • diskRenderOutputProcess – Defines the render action for a given render output as well as pre- and post-commands used in the render process.

  • outputName – The name of the render output (as defined in the corresponding RenderOutputDefine node).

  • outputPath – The target location for the render output.

  • renderMethodName – The render method used to launch the render.

  • frameTime – The current frame time.

FnAttribute::Attribute _configureDiskRenderOutputProcess(const std::string &outputName, const std::string &outputPath, const std::string &renderMethodName, const float &frameTime) const

Public Static Functions

static FnPlugStatus setHost(FnPluginHost *host)
static FnPluginHost *getHost()
static FnRenderPluginSuite createSuite(FnRenderPluginHandle (*create)(FnSgIteratorHandle, FnAttributeHandle))
static FnRenderPluginHandle newRenderHandle(RenderBase *renderBase)

Public Static Attributes

static unsigned int _apiVersion
static const char *_apiName

Protected Functions

inline Foundry::Katana::FnScenegraphIterator getRootIterator() const

The scene graph iterator is used to traverse the scene graph and author data to the renderer based on the scene graph type and attributes. The root iterator provides a starting point for the traversal as it contains the entire scene graph as well as any global scene attributes which are by convention assigned to the root location.

Returns:

The iterator for the root scene graph location

std::string getRenderMethodName() const

Retrieve the render method used to launch the render from the render arguments. The method name is passed to the RenderManager.StartRender function where the list of available methods is declared by RendererInfo::RendererInfoBase::fillRenderMethods in UI mode, and by configureBatchRenderMethod in batch mode, when creating debug outputs, and when rendering dependencies.

Returns:

The render method name used to launch the render process

std::string findArgument(const std::string &argumentName, const std::string &defaultValue = "") const

Retrieve a render argument by name. The standard render arguments are accessible through explicit functions but custom live render arguments which have been advertised in the live render tab using the startConfiguration policy type.

Parameters:
  • argumentName – The name of the render argument that should be retrieved

  • defaultValue – The value to return in case the argument doesn’t exist

Returns:

The render argument value

bool applyRenderThreadsOverride(int &numberOfRenderThreads) const

Update the number of render threads if a ‘threads’ argument is passed as a render argument. The thread value is passed to the render process in the following cases:

  • UI mode: The ‘interactiveRenderThreads3D’ value is used if ‘interactiveRenderThreadOverride’ is set to ‘Yes’ in the Preferences dialog under ‘application->rendering’.

  • Batch mode: The thread count is set using the ‘&#8212;threads3d’ argument when launching Katana.

Parameters:

numberOfRenderThreads – The render thread variable which is subject to the thread override

Returns:

true if an override was applied, false otherwise

inline std::string getKatanaBasePath() const
Returns:

The base path for Katana

inline std::string getKatanaTempDirectory() const

Get the name of the temporary directory Katana creates at startup which is used throughout the session.

Returns:

Katana’s temporary directory

inline std::string getKatanaHost() const

Get the host and port of Katana’s listener which is started when Katana is launched in UI mode. The listener is used to retrieve image and id data from the renderer plug-in.

Returns:

The host name for Katana’s image and id listener

float getRenderTime() const

Get the render time which is either a value retrieved from the timeline (UI mode), or a single frame from the interval provided by the -t command line argument when launching a batch render.

Returns:

The render time (frame)

bool useRenderPassID() const

Specifies whether an ID pass should be created. The user guide explains how to activate an ID pass in the monitor and how to use the picker tool.

See “Sending ID pass data to Katana” in the Katana Developer Guide for further information.

See also

Render::IdSenderFactory::getNewInstance

Note

A better function name might be shouldRenderIDPass().

Returns:

true if an ID pass should be created, false otherwise

inline std::string getRenderOutputFile() const

Returns the name of a file which Katana expects the render plug-in to create and populate with scene description data and/or debug information. See “Generating a render debug output” in the Katana Developer Guide.

Returns:

The name of the the render debug output file

bool isExpandProceduralActive(bool defaultValue = false) const

This function is used in conjunction with getRenderOutputFile where if a render output file is expected to be generated, and if the renderer supports recursive procedurals, then this determines whether the procedurals should be expanded or not.

Note

A better function name might be shouldExpandProcedurals().

Returns:

true if the procedurals should be expanded, false otherwise

inline std::string getRenderPluginDirectory() const

Returns the directory name where the render plug-in resides on disk.

Returns:

The render plug-in directory

std::string getEnvironmentVariable(const std::string &name) const

Looks up and returns the value of an environment variable by name.

Returns:

The value of the environment variable with the given name.

template<typename T, typename A>
inline T getAttrValue(const FnAttribute::Attribute &attr, const T &defaultValue) const

A helper function which retrieves and converts the value of an Attribute to a desired standard type. This is useful for instance when collecting custom rendererSettings values from the render outputs, e.g.:

int mySettings = getAttrValue<int, IntAttribute>(output.rendererSettings["mySettings"], 0);
Parameters:
  • attr – The Attribute that we want to retrieve the value from

  • defaultValue – Default value if the attribute is not valid

Returns:

The typed attribute value or the default value if the attribute is not valid

inline std::string getStringAttrValue(const FnAttribute::Attribute &attr, const std::string &defaultValue = "") const

A convenience function for retrieving the value of StringAttribute

Parameters:
  • attr – The StringAttribute that we want to retrieve the value from

  • defaultValue – Default string value if the attribute is not valid

Returns:

The string value contained in the attribute or the default value if the attribute is not valid

class RenderSettings
#include <RenderSettings.h>

A utility class which represents a collection of render settings which originate from the renderSettings attributes and other relevant modules. This class can be extended if renderer specific processing is required.

Note

Where applicable, the getter functions refer to the renderSettings attribute on the scene graph root.

Public Types

typedef std::map<std::string, ChannelBuffer> ChannelBuffers

A collection of channel buffers which is populated based on the selected interactive outputs in the render settings.

typedef std::map<std::string, std::string> Settings
typedef std::map<std::string, FnAttribute::Attribute> AttributeSettings
typedef std::map<std::string, CameraSettings*> CameraMap

Maps scene graph location names of cameras to the corresponding CameraSettings.

typedef std::map<std::string, RenderOutput> RenderOutputs

Maps render output names to a RenderOutput structure which contains the output’s attributes and values.

Public Functions

RenderSettings(Foundry::Katana::FnScenegraphIterator rootIterator)
Parameters:

rootIterator – The root scene graph iterator

inline virtual ~RenderSettings()
virtual int initialise()

Handles the render settings attribute parsing

Returns:

A zero value if successful, a non-zero value otherwise

inline bool isValid() const
Returns:

true if the render settings have been initialised using valid renderSettings attributes, false if the renderSettings attribute is not valid.

inline virtual std::string getCameraName() const
Returns:

The camera scene graph location (renderSettings.cameraName)

inline virtual CameraSettings *getCameraSettings() const

The CameraSettings class is created by using the camera name to look up and parse the attributes for the corresponding camera scene graph location.

Returns:

The camera settings class which represents the camera scene graph location attributes. Note that the CameraSettings object pointed to by the returned CameraSettings pointer is only valid for the lifetime of this RenderSettings object.

inline virtual CameraMap getAdditionalCameras() const

A collection of cameras defined by the render outputs. Each render output can reference a camera scene graph location (cameraName) where the attribute values for each location are parsed by CameraSettings if the parameter is locally set, and added to a map indexed by the camera scene graph location name.

See also

CameraSettings

Returns:

A map of per render output camera settings indexed by the camera name. Note that the he CameraSettings objects pointed to by the result CameraMap are only valid for the lifetime of this RenderSettings object.

virtual void getCropWindow(float cropWindow[4]) const

The crop window corresponding to the net region of interest

Note

Y-coordinates are top-down.

Parameters:

cropWindow – Output parameter where the crop window bounds will be returned as {xmin, xmax, ymin, ymax}.

virtual void getSampleRate(float sampleRate[2]) const

Returns the sample rate. Typical sample rates are:

  • (1.0, 1.0) = 100%

  • (0.5, 0.5) = 50%

  • (0.25, 0.25) = 25%

  • (0.125, 0.125) = 12.5%

Parameters:

sampleRate[out] The sample rate.

inline virtual std::string getResolutionName() const
Returns:

The name of the resolution (renderSettings.resolution)

inline virtual int getResolutionX() const
Returns:

The render resolution width (X) (renderSettings.resolution.X)

inline virtual int getResolutionY() const
Returns:

The render resolution height (Y) (renderSettings.resolution.Y)

virtual void getDisplayWindow(int displayWindow[4]) const

The display window spans the area from the origin (0, 0) to the resolution width and height (getResolutionX(), getResolutionY()).

Parameters:

displayWindow[out] The display window (0, 0, xRes, yRes).

virtual void getOverscan(int overscan[4]) const
Parameters:

overscan[out] The uniform overscan (renderSettings.overscan).

virtual void getDataWindow(int dataWindow[4]) const

The data window takes the overscan into account where it spans the display window plus the overscan.

Parameters:

dataWindow[out] The data window (display window + overscan).

virtual void getRegionOfInterest(int regionOfInterest[4]) const

Gets the net region of interest - this being the intersection of data window (including overscan), gross region of interest, and crop window - in pixel coordinates. Non-integer values (possible due to the fractional nature of crop window) are rounded toward zero.”

Parameters:

regionOfInterest – Output parameter where the active region of interest will be returned.

virtual void getRegionOfInterest(float regionOfInterest[4]) const

Gets the net region of interest - this being the intersection of data window (including overscan), gross region of interest, and crop window - in pixel coordinates. Non-integer values are possible due to the fractional nature of crop window.”

Parameters:

regionOfInterest – Output parameter where the active region of interest will be returned.

inline virtual std::string getRenderer() const
Returns:

The active renderer at render time (renderSettings.renderer)

virtual bool applyRenderThreads(int &renderThreads) const

Applies the number of render threads if they have been defined using renderSettings.renderThreads. The reason the function returns a boolean and the value is passed as a reference is because the thread value is allowed to be a zero value which generally asks the renderer to use all available cores, and a negative value where -1 typically represents a (no. cores - 1) value.

Note

This value is not exposed in the parameter list and has to be set using e.g. an AttributeSet node.

Parameters:

renderThreads – The value that will acquire the number of render threads if it has been set

Returns:

true if the render thread value was set, false otherwise

virtual void getInteractiveOutputs(std::vector<std::string> &outputs) const

Provides the list of selected interactive output channels as specified in the render settings where each interactive output corresponds to a ChannelBuffer.

Parameters:

outputs – Selected interactive outputs (renderSettings.interactiveOutputs)

virtual void getChannelBuffers(ChannelBuffers &channelBuffers)

Provides the channel buffers for the selected interactive outputs.

Parameters:

channelBuffers – The channel buffer map which will be populated with ChannelBuffer structures that correspond to the selected interactive outputs

inline virtual RenderOutputs getRenderOutputs() const

See also

RenderOutput

Returns:

A map of render outputs indexed by the output name (renderSettings.outputs)

virtual std::vector<std::string> getRenderOutputNames(const bool onlyEnabledOutputs = true) const
Returns:

The render output names in the order as they appear under (renderSettings.outputs)

inline virtual int getNumberOfRenderOutputs() const
Returns:

The number of render outputs used in disk/batch/debug renders

virtual RenderOutput getRenderOutputByName(const std::string &outputName) const
Returns:

inline virtual int getMaxTimeSamples() const
Returns:

The maximum number of time samples (renderSettings.maxTimeSamples)

inline virtual float getShutterOpen() const
Returns:

The shutter open value (renderSettings.shutterOpen)

inline virtual float getShutterClose() const
Returns:

The shutter close value (renderSettings.shutterClose)

inline virtual bool isTileRender() const

Tile rendering is set by adding a renderSettings.tileRender attribute which contains 4 integer values.

Returns:

true if tileRender is set under renderSettings, false otherwise

virtual void getWindowOrigin(int windowOrigin[2]) const
Parameters:

windowOrigin – The window origin with respect to the region of interest within the display window.

virtual void getDisplayWindowSize(int displayWindowSize[2]) const
Parameters:

displayWindowSize – The size (width and height) of the display window

virtual void getDataWindowSize(int dataWindowSize[2]) const
Parameters:

dataWindowSize – The size (width and height) of the data window

inline virtual std::string getRenderFinishedFilename() const
Returns:

Path to file that renderer can optionally create to signal that render completed successfully. Useful for renderers that tend to crash on exit.

Protected Types

typedef std::map<std::string, CameraSettings::Ptr> CameraMapPtrs

Protected Functions

void calculateCropWindow(float calculatedCropWindow[4]) const
void processColorOutput(RenderOutput &output, FnAttribute::GroupAttribute rendererSettingsAttr) const

Protected Attributes

Foundry::Katana::FnScenegraphIterator _rootIterator
bool _valid
CameraSettings::Ptr _camera
CameraMapPtrs _additionalCameras
std::string _renderer
std::string _cameraName
std::string _resolution
int _overscan[4]
int _displayWindow[4]
int _finalDisplayWindow[4]
int _dataWindow[4]
int _finalDataWindow[4]
float _cropWindow[4]
float _regionOfInterest[4]
int _finalRegionOfInterest[4]
int _xRes
int _yRes
float _sampleRate[2]
bool _useTileRender
int _tileRender[4]
FnAttribute::IntAttribute _renderThreadsAttr
int _maxTimeSamples
float _shutterOpen
float _shutterClose
std::string _interactiveOutputs
ChannelBuffers _buffers
RenderOutputs _renderOutputs
std::vector<std::string> _renderOutputNames
std::vector<std::string> _enabledRenderOutputNames
std::string _tempDir
std::string _renderFinishedFilename
struct ChannelBuffer
#include <RenderSettings.h>

Contains the channel names (AOVs) and the corresponding buffer IDs which are reserved in the catalog. This is only applicable for preview renders where the list of channels the user wants to render is configured using the interactiveOutputs parameter on the RenderSettings node. This allows a user to selectively preview render a list of channels, sometimes referred to as output variables, passes, and render elements.

Public Members

std::string channelName
std::string bufferId
struct RenderOutput
#include <RenderSettings.h>

Contains the values of a single render output on a render node which are typically set using a RenderOutputDefine node. The corresponding attributes are found on the scene graph root under renderSettings.outputs where they declare the target filename, color space, etc.

Note

This is only used for disk renders, batch renders, and debug outputs.

Public Members

std::string type
std::string locationType
std::string renderLocation
AttributeSettings rendererSettings
std::string colorSpace
std::string channel
std::string fileExtension
std::string cameraName
AttributeSettings convertSettings
bool clampOutput
bool colorConvert
std::string computeStats
std::string tempRenderLocation
std::string tempRenderId
bool enabled
class ScenegraphLocationDelegate
#include <ScenegraphLocationDelegate.h>

Super-Class that enables the creation of user-defined sub-classes and plug-ins responsible for processing/rendering different location types.

For each location type a class associated with a plug-in can be defined that processes/renders information related to the location into something else. A common cases are to retrieve location information from the scene graph iterator, render its geometry, or output a file. A ScenegraphLocationDelegate can be used as a generic way to handle locations and perform any operation

Using the macros DEFINE_SCENEGRAPH_LOCATION_DELEGATE_PLUGIN and REGISTER_PLUGIN a location plug-in is defined and it is detected by Katana at runtime.

For example:

DEFINE_SCENEGRAPH_LOCATION_DELEGATE_PLUGIN(ArnoldSphereScenegraphLocationDelegate)

REGISTER_PLUGIN(ArnoldSphereScenegraphLocationDelegate, “ArnoldSphereScenegraphLocationDelegate”, 0, 1)

associates the ScenegraphLocationDelegate sub-class ArnoldSphereScenegraphLocationDelegate to be responsible for processing/rendering a location type named “sphere” for the “arnold” renderer. The second parameter must a be a Katana-wide unique string. The registration gives priority to the plugins that are discovered first in the directory hierarchy.

Another requirement for the sub-classes is to provide 4 additional methods e.g.:

static void flush(); reset/update the state of the object

static XXX* create(); creates an instance of the sub-class XXX

std::string getSupportedRenderer() returns a string of the supported renderer name. If the string is empty then all renderers are supported. If there is a delegate that supports a specific renderer for a given location it is given priority over any delegate that supports all renderers. void fillSupportedLocationList(std::vector<std::string>& supportedLocationList) populates a vector of strings naming all the supported locations, e.g. a “polymesh”

Public Functions

inline virtual ~ScenegraphLocationDelegate()
inline void bootstrap(void *ptr)
virtual void *process(FnScenegraphIterator sgIterator, void *optionalInput) = 0

Process/renders a given location, must be implemented by sub-classes.

Method responsible for processing/rendering a given location, passed as a scene graph iterator. Return is implementation depended.

Parameters:
  • sgIterator – the iterator referring to a location. Its expected value matches the iterator type used when then subclass was registered with the REGISTER_PLUGIN macro.

  • optionalInput – optional input, its use and value depends on the implementation.

inline virtual std::string getSupportedRenderer() const
virtual void fillSupportedLocationList(std::vector<std::string> &supportedLocationList) const = 0

Public Static Functions

static FnScenegraphLocationDelegatePluginSuite_v1 createSuite(FnLocationHandle (*create)())
static FnPlugStatus setHost(FnPluginHost *host)
static FnLocationHandle newLocationHandle(ScenegraphLocationDelegate *location)

Public Static Attributes

static unsigned int _apiVersion
static const char *_apiName
class TemporaryRenderAction : public Foundry::Katana::Render::RenderAction
#include <TemporaryRenderAction.h>

A render action which renders to a temporary location.

This action renders a file to a temporary location which is deleted when the render is complete unless the KATANA_KEEP_TEMP_RENDER_FILES environment variable is set. By default nothing is loaded into the monitor when using this action.

This action is useful when e.g. a post process is required where a temporary file is written to disk and then processed using a custom command.

A render action needs to declare an output for each port on the render node in order to allow a render process to start. Therefore, a render pass that is not expected to produce a render output still needs to use this temporary render action regardless of whether the temporary render location is used anywhere.

Public Functions

TemporaryRenderAction(const std::string &tempRenderLocation)
inline virtual ~TemporaryRenderAction()
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const
class RendererInfoBase
#include <RendererInfoBase.h>

The renderer info plug-in provides Katana with renderer specific information such as shaders and render outputs, as well as configuring how a render is launched.

Populating renderer-specific UI parameters

A renderer object defines renderer-specific properties which can be configured and assigned in a Katana scene. The types of renderer object are defined in RendererObjectDefinitions.h and include e.g. shader, render output, output channel, procedural, etc. The RendererInfoBase::buildRendererObjectInfo builds an object’s properties and parameters.

Creating these renderer objects in the UI generally require selecting a particular object from a list of typed renderer object names which is populated by RendererInfoBase::fillRendererObjectNames. In some cases, the object names are filtered based on a list of types which is populated by RendererInfoBase::fillRendererObjectTypes.

An example of this process is the use of the Material node which uses the RendererObjectDefinitions::kFnRendererObjectTypeShader type:

  • The user clicks ‘Add Shader’ in the Material node which populates a list of shader types such as surface, displacement, etc. in a drop-down list. This list of shader types is populated by RendererInfoBase::fillRendererObjectTypes. A typed shader widget appears below the button where it is named ‘[rendererName][RendererObjectType]Shader’.

  • The user clicks the typed shader widget to get the list of available shader names for the corresponding renderer object type. The shader names appear in a drop-down list which is populated by RendererInfoBase::fillRendererObjectNames where the selected shader type is passed as a type tag. The co-shader type is included in the type tags if co-shaders are supported (see RendererInfoBase::getRendererCoshaderType).

  • Once a user has selected a shader from the drop-down list, RendererInfo::RendererInfoBase::buildRendererObjectInfo is called with the selected shader name in order to populate the UI with the corresponding shader parameters.

Public Types

typedef std::pair<std::string, FnAttribute::GroupAttribute> OpDefinition
typedef std::deque<OpDefinition> OpDefinitionQueue

Public Functions

RendererInfoBase()
inline virtual ~RendererInfoBase()
virtual void configureBatchRenderMethod(RendererInfo::DiskRenderMethod &batchRenderMethod) const = 0

Configure the render method used for batch rendering. A batch render method is always added automatically but here it can be customised if needed.

Parameters:

batchRenderMethod – The batch render method.

virtual void fillRenderMethods(std::vector<RendererInfo::RenderMethod*> &renderMethods) const = 0

Advertise supported render methods.

Parameters:

renderMethods – A reference container for supported render methods.

virtual void fillRendererObjectTypes(std::vector<std::string> &renderObjectTypes, const std::string &type) const = 0

Advertise supported types for a given renderer object type. The supported renderer object types are defined in RendererObjectDefinitions where the following conventions are typically used:

  • RendererObjectDefinitions::kFnRendererObjectTypeShader: The advertised types populate the ‘Add Shader’ drop-down list in the Material node (e.g. surface, displacement, etc.)

  • RendererObjectDefinitions::kFnRendererObjectTypeRenderOutput: The advertised renderer types populate the ‘type’ drop-down list in the RenderOutputDefine node (e.g. color, raw, etc.)

See Populating renderer-specific UI parameters for more information.

Parameters:
  • renderObjectTypes – The advertised types for a given renderer object type.

  • type – The renderer object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader).

virtual std::string getRendererObjectDefaultType(const std::string &type) const

The default renderer value for a given object type if applicable.

See Populating renderer-specific UI parameters for more information.

Parameters:

type – An object type (e.g. renderOutput)

Returns:

The default renderer type (e.g. kFnRendererOutputTypeColor)

inline virtual void fillLiveRenderTerminalOps(OpDefinitionQueue &terminalOps, const FnAttribute::GroupAttribute &stateArgs) const

Populate a list of terminal Op definitions that should be applied to the Op Tree during Live Rendering.

Parameters:
  • terminalOps – The populated terminal op deffinitions. The expected format is a deque containing a std::pair<string, GroupAttribute>. The string is the name of the op and the GroupAttribute is the op args.

  • stateArgs – A GroupAttribute containing some extra information. Contains the entries defined by the constants:

    • kFnTerminalOpStateArgRenderMethodType - the render method type, which will be one of the strings defined by the constants starting with kFnRenderMethodType.

    • kTerminalOpStateArgSystem - the Op System Args, as defined by the GraphState. It contains information like: currentTime, shutter info, numSamples, etc.

inline virtual void fillRenderTerminalOps(OpDefinitionQueue &terminalOps, const FnAttribute::GroupAttribute &stateArgs) const

Populate a list of terminal Op definitions that should be applied to the Op Tree during specified render mode.

Parameters:
  • terminalOps – The populated terminal op definitions. The expected format is a deque containing a std::pair<string, GroupAttribute>. The string is the name of the op and the GroupAttribute is the op args.

  • stateArgs – A GroupAttribute containing some extra information. Contains the entries defined by the constants:

    • kFnTerminalOpStateArgRenderMethodType - the render method type, which will be one of the strings defined by the constants starting with kFnRenderMethodType.

    • kTerminalOpStateArgSystem - the Op System Args, as defined by the GraphState. It contains information like: currentTime, shutter info, numSamples, etc.

virtual void fillRendererObjectNames(std::vector<std::string> &rendererObjectNames, const std::string &type, const std::vector<std::string> &typeTags) const = 0

Advertise available names for a given renderer object type and type tags. This is used to provide a list of UI options for shaders, drivers, filters, etc. The type tags can be used to filter the list of available names.

See Populating renderer-specific UI parameters for more information.

Parameters:
  • rendererObjectNames – The names of available render objects (e.g. shader names)

  • type – The render object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader)

  • typeTags – Filter tags which typically include the selected render object type (e.g. surface) which can be used to filter the object names based on the user’s selection in the UI.

virtual std::string getRegisteredRendererName() const = 0

Registered renderer name that corresponds to this renderer info

Returns:

The renderer plug-in that corresponds to this renderer info plug-in

virtual std::string getRegisteredRendererVersion() const = 0

Registered version of the renderer this renderer info is used with.

Returns:

The renderer version

inline virtual bool isPresetLocalFileNeeded(const std::string &outputType) const

Declares if a renderer output requires a pre-declared temporary file (accessible in scene graph with implicit resolvers).

Parameters:

outputType – A render output type

Returns:

true if a local file is needed, false otherwise

inline virtual bool isNodeTypeSupported(const std::string &nodeType) const

Katana will call this function to determine if the renderer supports specific nodes. Currently, Katana only queries whether the ShadingNode and OutputChannelDefine are supported.

Parameters:

nodeType – The node type

Returns:

true if the node type is supported, false otherwise

inline virtual bool isPolymeshFacesetSplittingEnabled() const

Declares if polymesh faces are split into sub-meshes where each mesh represents a single face-set.

Returns:

true if polymesh face-set splitting is enabled, false otherwise

virtual void fillShaderInputNames(std::vector<std::string> &shaderInputNames, const std::string &shaderName) const

Populate shader input names for a given shader in a shading node. This can be used to validate the shading connections.

Parameters:
  • shaderInputNames – The populated input names for a given shader.

  • shaderName – The name of the shader which will be populated with the input names.

virtual void fillShaderInputTags(std::vector<std::string> &shaderInputTags, const std::string &shaderName, const std::string &inputName) const

Populate shader input tags for a given input on a shader in a shading node. The tags describe what kind of connections are valid when connecting to this input, e.g.:

shaderInputTags.push_back("float or rgb or rgba or vector or point or point2");
Parameters:
  • shaderInputTags – The populated input tags for a given input on a shader.

  • shaderName – The name of the shader which will be populated with the input tags.

  • inputName – The input name on the shader.

virtual void fillShaderOutputNames(std::vector<std::string> &shaderOutputNames, const std::string &shaderName) const

Populate shader output names for a given shader in a shading node. This can be used to validate the shading connections.

Parameters:
  • shaderOutputNames – The populated output names for a given shader.

  • shaderName – The name of the shader which will be populated with the output names.

virtual void fillShaderOutputTags(std::vector<std::string> &shaderOutputTags, const std::string &shaderName, const std::string &outputName) const

Populate shader output tags for a given output on a shader in a shading node. The tags describe what kind of connections are valid when connecting to this output , e.g.:

shaderOutputTags.push_back("float");
Parameters:
  • shaderOutputTags – The populated output tags for a given output on a shader.

  • shaderName – The name of the shader which will be populated with the output tags.

  • outputName – The output name on the shader.

virtual void fillRendererShaderTypeTags(std::vector<std::string> &shaderTypeTags, const std::string &shaderType) const
inline virtual std::string getRendererCoshaderType() const

Specifies the shader type for coshaders if they are supported.

Returns:

The co-shader type if applicable. An empty string signifies that co-shaders are not supported.

inline virtual void buildLiveRenderControlModules(FnAttribute::GroupBuilder &liveRenderControlModules) const

Build custom live render modules for the live render tab.

Deprecated:

All commands, data updates, and terminal Ops required should use the LiveRenderAPI Python module.

Parameters:

liveRenderControlModules – Attributes describing the custom live render modules.

virtual bool buildRendererObjectInfo(FnAttribute::GroupBuilder &rendererObjectInfo, const std::string &name, const std::string &type, const FnAttribute::GroupAttribute inputAttr) const = 0

Build the attributes describing the renderer object information which includes e.g. its name, type, locations, and parameters.

See Populating renderer-specific UI parameters for more information.

Parameters:
  • rendererObjectInfo – The attributes containing the renderer object information requested by Katana.

  • name – The renderer object name selected in the UI (e.g. shader name)

  • type – The render object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader)

  • inputAttr – Optional input attributes.

Returns:

true if the build process was successful, false otherwise.

inline virtual void flushCaches()

Flush cached data (e.g. shader information).

std::string getPluginPath() const

Accessor for the path to the Render Plug-in. In most cases this will be a directory named ‘Libs’ within the root path of the plug-in (if you want to access the root path, you can use the function getPluginRootPath instead).

Returns:

Full path to the directory containing the Render plug-in.

std::string getPluginRootPath() const

Convenience function to access the parent directory of the plugin path (see getPluginPath())

In addition to the ‘Libs’ directory in which the plugin’s DSOs reside, the plugin’s root directory will commonly hold python plugins for Viewer Manipulators, nodes, etc. as well as any settings or shared libraries used by the Render Plug-in.

Returns:

Full path to the plug-in’s ‘root’ directory.

void setPluginPath(const std::string &pluginPath)
void setPluginRootPath(const std::string &pluginRootPath)
void setKatanaPath(const std::string &katana_path)
std::string getKatanaPath() const
void setTmpPath(const std::string &tmp_path)
std::string getTmpPath() const
FnAttribute::Attribute _getRenderMethods()
FnAttribute::Attribute _getBatchRenderMethod()
FnAttribute::Attribute _getRendererObjectNames(const std::string &type, const std::vector<std::string> &typeTags)
FnAttribute::Attribute _getRendererObjectTypes(const std::string &type)
FnAttribute::Attribute _getRendererShaderTypeTags(const std::string &shaderType)
FnAttribute::Attribute _getRendererCoshaderType()
FnAttribute::Attribute _getRegisteredRendererName()
FnAttribute::Attribute _getRegisteredRendererVersion()
FnAttribute::Attribute _getRendererObjectDefaultType(const std::string &type)
FnAttribute::Attribute _getShaderInputNames(const std::string &shaderName)
FnAttribute::Attribute _getShaderInputTags(const std::string &shaderName, const std::string &inputName)
FnAttribute::Attribute _getShaderOutputNames(const std::string &shaderName)
FnAttribute::Attribute _getShaderOutputTags(const std::string &shaderName, const std::string &outputName)
FnAttribute::Attribute _getRendererObjectInfo(const std::string &name, const std::string &typeTag, const FnAttributeHandle inputData = 0x0)
void _setTypeTagNameFilter(const std::string &filter, const std::string &typeTag)
void _addObjectLocation(const std::string &type, const std::string &location)
void _clearObjectLocations(const std::string &type)
void _flushCaches()
FnAttribute::Attribute _getLiveRenderTerminalOps(const FnAttributeHandle stateArgs)
FnAttribute::Attribute _getRenderTerminalOps(const FnAttributeHandle stateArgs)

Public Static Functions

static void configureBasicRenderObjectInfo(FnAttribute::GroupBuilder &renderObjectInfo, const std::string &type, const std::vector<std::string> &typeTags, const std::string &location, const std::string &fullPath, int outputType, FnAttribute::Attribute containerHints)

A utility function for building render object info. It builds the attribute convention for declaring the properties of render objects such as shaders.

Parameters:
  • renderObjectInfo – The group attribute which defines the render object

  • type – The render object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader)

  • typeTags – Tags associated with the render object type (e.g. shader type)

  • location – The location of the render object if applicable

  • fullPath – The full path of the render object

  • outputType – The output type if supported, otherwise use kFnRendererObjectValueTypeUnknown

  • containerHints – An empty attribute represents no hints, whereas a group attribute containing one or more StringAttribute is interpreted as container hints which can be used to specify help texts for pages, and whether they are hidden or open by default.

Protected Types

typedef std::pair<std::string, int> EnumPair
typedef std::vector<EnumPair> EnumPairVector
typedef std::map<std::string, std::vector<std::string>> ObjectLocationsMap

Protected Functions

void addRenderObjectParam(FnAttribute::GroupBuilder &renderObjectInfo, const std::string &name, int type, int arraySize, FnAttribute::Attribute defaultAttr, FnAttribute::Attribute hintsAttr, const EnumPairVector &enumValues) const

A utility function for adding a parameter to a render object when building the render object info. It builds an attribute which describes parameters (e.g. shader parameters) and their properties such as their type and UI hints.

Parameters:
  • renderObjectInfo – The renderer object info which contains the parameter

  • name – The parameter name

  • type – The parameter type (e.g. RendererObjectDefinitions::kFnRendererObjectValueTypeColor3)

  • arraySize – The parameter array size (an array if the size is > 1)

  • defaultAttr – The default parameter value stored as a typed attribute

  • hintsAttr – UI hints for the parameter

  • enumValues – Enumerated value pairs for the parameter

void setShaderParameterMapping(FnAttribute::GroupBuilder &renderObjectInfo, const std::string &metaName, const std::string &actualName) const

A utility function that sets a container hint in the given render object info group builder structure to map a shader parameter attribute meta name, such as “material.meta.color”, to a single actual shader parameter attribute name, such as “material.prmanLightParams.lightcolor”.

Attribute meta names are used in the SceneGraphView widget to determine what values to show in the columns of its table.

Parameters:
  • renderObjectInfo – The renderer object info to modify.

  • metaName – The meta name of the attribute to map an actual attribute to.

  • actualName – The name of the actual attribute to map the meta attribute to.

void setShaderParameterMapping(FnAttribute::GroupBuilder &renderObjectInfo, const std::string &metaName, const std::vector<std::string> &actualNames) const

A utility function that sets a container hint in the given render object info group builder structure to map a shader parameter attribute meta name, such as “material.meta.color”, to a list of actual shader parameter attribute names, such as “material.prmanLightParams.lightcolor” and “material.prmanLightParams.Color”.

Attribute meta names are used in the SceneGraphView widget to determine what values to show in the columns of its table.

Parameters:
  • renderObjectInfo – The renderer object info to modify.

  • metaName – The meta name of the attribute to map a list of actual attributes to.

  • actualNames – A list of names of the actual attributes to map the meta attribute to.

void getTypeTagsUsingNameFilters(const std::string &name, std::set<std::string> &typeTags) const
bool findTypeTagsInObjectTypeTags(const std::vector<std::string> &typeTags, const std::set<std::string> &objectTypeTags) const
inline const ObjectLocationsMap &getAdditionalObjectLocations() const
inline const std::vector<std::string> &getAdditionalObjectLocations(const std::string &type) const
class RenderMethod
#include <RenderMethod.h>

Subclassed by Foundry::Katana::RendererInfo::DiskRenderMethod, Foundry::Katana::RendererInfo::LiveRenderMethod, Foundry::Katana::RendererInfo::PreviewRenderMethod

Public Functions

RenderMethod(const std::string &name, const std::string &label)
inline virtual ~RenderMethod()
virtual std::string getType() const = 0
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const = 0
virtual void setName(const std::string &name)
virtual std::string getName() const
virtual void setLabel(const std::string &label)
virtual std::string getLabel() const
virtual void setCreateCatalogItem(bool createCatalogItem)
virtual bool isCreateCatalogItem() const
virtual void setReportRenderMessages(bool reportRenderMessages)
virtual bool isReportRenderMessages() const
virtual void setRegisterRender(bool registerRender)
virtual bool isRegisterRender() const
virtual void setDebugOutputSupported(bool debugOutputSupported)
virtual bool isDebugOutputSupported() const
virtual void setSceneGraphDebugOutputSupported(bool sceneGraphDebugOutputSupported)
virtual bool isSceneGraphDebugOutputSupported() const
virtual void setDebugOutputFileType(const std::string &debugOutputFileType)
virtual std::string getDebugOutputFileType() const
virtual void setVisible(bool visible)
virtual bool isVisible() const

Protected Attributes

std::string _name
std::string _label
std::string _debugOutputFileType
bool _createCatalogItem
bool _reportRenderMessages
bool _registerRender
bool _debugOutputSupported
bool _sceneGraphDebugOutputSupported
bool _visible
class DiskRenderMethod : public Foundry::Katana::RendererInfo::RenderMethod
#include <RenderMethod.h>

Public Functions

DiskRenderMethod()
DiskRenderMethod(const std::string &name, const std::string &label)
inline virtual ~DiskRenderMethod()
inline virtual std::string getType() const
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const
void setAllowWaitingForRenderCompletion(bool allowWaitingForRenderCompletion)
bool isAllowWaitingForRenderCompletion() const

Public Static Attributes

static const char *kType
static const char *kDefaultLabel
static const char *kDefaultName
static const char *kBatchName

Protected Attributes

bool _allowWaitingForRenderCompletion
class PreviewRenderMethod : public Foundry::Katana::RendererInfo::RenderMethod
#include <RenderMethod.h>

Public Functions

PreviewRenderMethod()
PreviewRenderMethod(const std::string &name, const std::string &label)
inline virtual ~PreviewRenderMethod()
inline virtual std::string getType() const
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const

Public Static Attributes

static const char *kType
static const char *kDefaultLabel
static const char *kDefaultName
class LiveRenderMethod : public Foundry::Katana::RendererInfo::RenderMethod
#include <RenderMethod.h>

Public Functions

LiveRenderMethod()
LiveRenderMethod(const std::string &name, const std::string &label)
inline virtual ~LiveRenderMethod()
inline virtual std::string getType() const
virtual void buildAttribute(FnAttribute::GroupBuilder &builder) const

Public Static Attributes

static const char *kType
static const char *kDefaultLabel
static const char *kDefaultName
template<typename TShaderInfoType>
class ShaderInfoCache
#include <ShaderInfoCache.h>

Caches a map of shader names and attributes for quick access by Renderer Info Plug-ins.

Public Types

typedef std::map<std::string, TShaderInfoType>::const_iterator Iterator

Public Functions

bool isEmpty() const

Queries whether the cache is empty.

Returns:

True if empty, false otherwise.

void flush()

Flush the cache, removing all data from it.

void addShaderInfo(const std::string &shaderName, const TShaderInfoType &shaderInfo)

Adds information about a single shader to the cache.

Parameters:
  • shaderName – A string representing the unique name of the shader.

  • shaderInfo – A group attribute holding information pertaining to the shader.

const TShaderInfoType &getShaderInfo(const std::string &shaderName) const

Allows access to information about a shader.

Parameters:

shaderName – Unique name of the shader to retreive information for.

Returns:

If information about the named shader was previously cached, that info is returned. Otherwise, an empty Group Attribute.

Iterator begin() const

Gets a const iterator to the first Shader’s information stored in the cache.

Returns:

Const iterator to first Shader’s information cache entry.

Iterator end() const

Gets a const iterator to the end of the cache.

Returns:

Const iterator to the end of the cache.

void setNullValue(const TShaderInfoType &nullValue)

Sets the null value, which is returned if a cache item is empty or unavailable.

Parameters:

nullValue – The null value.

class CameraInfo
#include <CameraInfo.h>

CameraInfo.

Public Functions

CameraInfo(CameraInfoHandle handle)
~CameraInfo()
CameraInfo(const CameraInfo &rhs)
CameraInfo &operator=(const CameraInfo &rhs)
inline bool isValid() const

isValid

float getFov() const

getFov

float getNear() const

getNear

float getFar() const

getFar

float getLeft() const

getLeft

float getRight() const

getRight

float getTop() const

getTop

float getBottom() const

getBottom

int getOrtho() const

getOrtho

float getOrthoWidth() const

getOrthoWidth

double *getXForm() const

getXForm

Protected Functions

void acceptHandle(const CameraInfo &rhs)
struct ProceduralOutputContextInfo
#include <FnRenderOutputUtils.h>

ProceduralOutputContextInfo

Public Functions

inline ProceduralOutputContextInfo()

Public Members

int _frameNumber
float _shutterOpen
float _shutterClose
float _cropWindowXMin
float _cropWindowXMax
float _cropWindowYMin
float _cropWindowYMax
int _xres
int _yres
struct Transform
#include <FnRenderOutputUtils.h>

Transform

Public Members

TransformList transformList
std::vector<float> sampleTimes
class ShadingNodeConnectionDescription
#include <ShadingNodeConnectionDescription.h>

ShadingNodeConnectionDescription.

Public Functions

ShadingNodeConnectionDescription(ShadingNodeConnectionDescriptionHandle handle)
~ShadingNodeConnectionDescription()
ShadingNodeConnectionDescription(const ShadingNodeConnectionDescription &rhs)
ShadingNodeConnectionDescription &operator=(const ShadingNodeConnectionDescription &rhs)
inline bool isValid() const

isValid

std::string getName() const

getName

std::string getConnectedNodeName() const

getConnectedNodeName

std::string getConnectedPortName() const

getConnectedPortName

Protected Functions

void acceptHandle(const ShadingNodeConnectionDescription &rhs)
class ShadingNodeDescription
#include <ShadingNodeDescription.h>

ShadingNodeDescription.

Public Functions

ShadingNodeDescription(ShadingNodeDescriptionHandle handle)
~ShadingNodeDescription()
ShadingNodeDescription(const ShadingNodeDescription &rhs)
ShadingNodeDescription &operator=(const ShadingNodeDescription &rhs)
inline bool isValid() const

isValid

std::string getName() const

getName

std::string getType() const

getType

unsigned int getNumberOfParameterNames() const

getNumberOfParameterNames

std::string getParameterName(unsigned int index) const

getParameterName

FnAttribute::Attribute getParameter(const std::string &name) const

getParameter

unsigned int getNumberOfConnectionNames() const

getNumberOfConnectionNames

std::string getConnectionName(unsigned int index) const

getConnectionName

ShadingNodeConnectionDescription getConnection(const std::string &name) const

getConnection

Protected Functions

void acceptHandle(const ShadingNodeDescription &rhs)
class ShadingNodeDescriptionMap
#include <ShadingNodeDescriptionMap.h>

ShadingNodeDescriptionMap.

Public Functions

ShadingNodeDescriptionMap(FnAttribute::GroupAttribute materialAttr)

ShadingNodeDescriptionMap

ShadingNodeDescriptionMap(FnScenegraphIterator sgIterator)

ShadingNodeDescriptionMap

~ShadingNodeDescriptionMap()
inline bool isValid() const

isValid

ShadingNodeDescription getShadingNodeDescriptionByName(const std::string &name) const

getShadingNodeDescriptionByName

class XFormMatrix
#include <XFormMatrix.h>

Public Functions

XFormMatrix(const double *values)

XFormMatrix

XFormMatrix(const XFormMatrix &matrix)

XFormMatrix

const double *getValues() const

getValues

bool invert()

invert