Render API¶
-
enum
RenderAPI::
LiveRenderFilterMode
¶ Values:
-
kLiveRenderFilterMode_Append
¶
-
kLiveRenderFilterMode_Replace
¶
-
-
enum
RenderAPI::
SceneGraphTraversalMode
¶ Values:
-
kSceneGraphTraversalMode_LocationOrigin
¶
-
kSceneGraphTraversalMode_RecursiveFromSelection
¶
-
kSceneGraphTraversalMode_SelectedLocations
¶
-
kSceneGraphTraversalMode_SelectedLocationsRecursive
¶
-
-
enum
RenderAPI::
ProceduralArgsType
¶ Values:
-
kProceduralArgsType_Classic
¶
-
kProceduralArgsType_ScenegraphAttr
¶
-
-
std::string
Foundry::Katana::RenderOutputUtils::
buildProceduralArgsString
(FnScenegraphIterator sgIterator, ProceduralArgsType type, const std::string &argsAttrName, const ProceduralOutputContextInfo &contextInfo)¶
-
void
Foundry::Katana::RenderOutputUtils::
flushProceduralDsoCaches
(const std::string &apiName = "")¶ flushProceduralDsoCaches
-
int
Foundry::Katana::RenderOutputUtils::
getPixelAreaThroughCamera
(FnScenegraphIterator sgIterator, const std::string &cameraName, const std::string &resolution)¶ getPixelAreaThroughCamera
-
void
Foundry::Katana::RenderOutputUtils::
findSampleTimesRelevantToShutterRange
(std::vector<float> &sampleTimes, const std::set<float> &inputSamples, float shutterOpen, float shutterClose)¶ findSampleTimesRelevantToShutterRange
-
std::string
Foundry::Katana::RenderOutputUtils::
getRenderResolution
(FnScenegraphIterator rootIterator, int *width, int *height)¶ getRenderResolution
-
std::string
Foundry::Katana::RenderOutputUtils::
getCameraPath
(FnScenegraphIterator rootIterator)¶ getCameraPath
-
void
Foundry::Katana::RenderOutputUtils::
fillXFormListForLocation
(std::vector<Transform> &xFormList, FnScenegraphIterator sgIterator, float shutterClose = 0.0f)¶ fillXFormListForLocation
-
bool
Foundry::Katana::RenderOutputUtils::
fillXFormListFromAttributes
(std::vector<Transform> &xFormList, const FnAttribute::GroupAttribute &xformAttr, float shutterClose = 0.0f, bool invertMatrix = true)¶ fillXFormListFromAttributes
-
FnAttribute::GroupAttribute
Foundry::Katana::RenderOutputUtils::
convertTexturesToArbitraryAttr
(const FnAttribute::GroupAttribute &texturesAttr)¶ convertTexturesToArbitraryAttr
-
FnAttribute::GroupAttribute
Foundry::Katana::RenderOutputUtils::
getFlattenedMaterialAttr
(FnScenegraphIterator sgIterator, const FnAttribute::StringAttribute &terminalNamesAttr)¶ getFlattenedMaterialAttr
-
void
Foundry::Katana::RenderOutputUtils::
emptyFlattenedMaterialCache
()¶ emptyFlattenedMaterialCache
-
CameraInfo
Foundry::Katana::RenderOutputUtils::
getCameraInfo
(FnScenegraphIterator sgIterator, const std::string &cameraInfoPath)¶ getCameraInfo
-
Foundry::Katana::RenderOutputUtils::
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.
- Return
- true if a plug-in is found, false otherwise.
- 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.
-
Foundry::Katana::RenderOutputUtils::
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
-
Foundry::Katana::RenderOutputUtils::
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.
- Return
- The built temporary location for the 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
-
Foundry::Katana::RenderOutputUtils::
buildTileLocation
(FnScenegraphIterator sgIterator, const std::string &outputPath)¶ Build a tile location from the render settings for a given output path.
- Return
- The location to a tile location which consists of the output path and the built tile filename using the tile render settings
- Parameters
sgIterator
-The root scene graph iterator
outputPath
-The output path for the built tile filename
-
class
Foundry::Katana::Render::
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
-
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])
-
virtual
~CameraSettings
()¶
-
virtual int
initialise
(int displayWindow[4], int overscan[4], float shutterClose = 0.0f)¶ Handles the camera attribute parsing
- Return
- A zero value if successful, a non-zero value otherwise
- 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)
-
std::string
getName
() const¶ - Return
- The camera’s scene graph location name.
-
std::string
getProjection
() const¶ - Return
- The camera’s projection, e.g. ‘perspective’ (geometry.projection)
-
float
getFov
() const¶ - Return
- The camera’s field of view (geometry.fov)
-
void
getClipping
(float clipping[2]) const¶ - Return
- The camera’s clipping plane (near, far) (geometry.near and geometry.far)
-
void
getScreenWindow
(float screenWindow[4]) const¶ - Return
- The camera’s screen window (left, right, bottom, top)
-
std::vector<FnRenderOutputUtils::RenderOutputUtils::Transform>
getTransforms
() const¶ - Return
- The camera’s transform (inverse xform attribute list)
-
class
Foundry::Katana::Render::
CopyAndConvertRenderAction
¶ - #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.
Inherits from Foundry::Katana::Render::CopyRenderAction
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.
-
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
Foundry::Katana::Render::
CopyRenderAction
¶ - #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.
Inherits from Foundry::Katana::Render::RenderAction
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.
-
virtual
~CopyRenderAction
()¶
-
virtual void
buildAttribute
(FnAttribute::GroupBuilder &builder) const¶
Protected Attributes
-
std::string
_tempRenderLocation
¶
-
class
Foundry::Katana::Render::
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
¶
Public Functions
-
DiskRenderOutputProcess
()¶
-
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¶
-
typedef FnPlatform::internal::UniquePtr<RenderAction>
-
class
Foundry::Katana::Render::
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).
-
virtual
~GlobalSettings
()¶
-
virtual int
initialise
(const std::string &rendererNamespace)¶ Parses the the global settings attributes
- Return
- A zero value if successful, a non-zero value otherwise
- Parameters
rendererNamespace
-The namespace used (typically the renderer name) to define the global settings group attribute for the renderer ([rendererNamespace]GlobalStatements).
-
GroupAttribute
getGlobalSettingsAttr
() const¶ - Return
- The group attribute containing the global settings ([rendererNamespace]GlobalStatements)
-
-
class
Foundry::Katana::Render::
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
-
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
-
virtual
-
class
Foundry::Katana::Render::
NoOutputRenderAction
¶ - #include <NoOutputRenderAction.h>
A render action which does not specify any output locations.
Inherits from Foundry::Katana::Render::RenderAction
-
class
Foundry::Katana::Render::
PostCommandsRenderAction
¶ - #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.
Inherits from Foundry::Katana::Render::CopyRenderAction
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.
-
virtual
~PostCommandsRenderAction
()¶
-
virtual void
buildAttribute
(FnAttribute::GroupBuilder &builder) const¶
-
void
addCleanupFile
(const std::string &cleanupFile)¶
-
class
Foundry::Katana::Render::
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.
-
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.
-
-
class
Foundry::Katana::Render::
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.
Subclassed by CompanyName::Katana::TemplateRenderPlugin, ProfilingMockRenderer::RenderPlugin
Public Functions
-
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.
- See
- Render::RenderBase::getRootIterator
- Parameters
rootIterator
-The root FnScenegraphIterator used to traverse the scene graph produced by a Katana recipe
arguments
-Render arguments (e.g. render time)
-
virtual
~RenderBase
()¶
-
virtual int
setup
()¶ Set up the render plug-in so that it is ready to perform one or more renders.
- Return
- A zero value if successful, a non-zero value otherwise.
-
virtual int
cleanup
()¶ Clean up any resources that the render plug-in has allocated.
- Return
- A zero value if successful, a non-zero value otherwise.
-
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.
- Return
- A zero value if successful, a non-zero value otherwise.
-
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.
- Return
- A zero value if successful, a non-zero value otherwise.
-
virtual int
resume
()¶ Resume a paused render.
- Note
- This is currently never called.
- Return
- A zero value if successful, a non-zero value otherwise.
-
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.
- Return
- A zero value if successful, a non-zero value otherwise.
-
virtual int
startLiveEditing
()¶ Start the live render process. Data updates and control commands will follow.
- Return
- A zero value if successful, a non-zero value otherwise.
-
virtual int
stopLiveEditing
()¶ Stop the live render process. No further data updates or control commands should be expected.
- Return
- A zero value if successful, a non-zero value otherwise.
-
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.
- Return
- A zero value if successful, a non-zero value otherwise.
- Parameters
command
-Live render control command
-
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();
This function is called from a separate update thread whereas hasPendingDataUpdates and applyPendingDataUpdates are called in the main render process thread.
- Return
- A zero value if successful, a non-zero value otherwise.
- See
- Parameters
updateAttribute
-A group attribute containing one or more update attributes.
-
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.
- Return
- A zero value if successful, a non-zero value otherwise.
- See
-
virtual bool
hasPendingDataUpdates
() const¶ Inform the render process whether it has to flush and apply live updates.
- Return
- true if there are updates which have to be applied, false otherwise
- See
-
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.
- See
Render::DiskRenderOutputProcess
Render::CopyAndConvertRenderAction
Render::RenderSettings::RenderOutputs
- 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)¶
Protected Functions
-
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.
- Return
- 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.
- Return
- The render method name used to launch the render process
- See
-
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.
- Return
- The render argument value
- Parameters
argumentName
-The name of the render argument that should be retrieved
defaultValue
-The value to return in case the argument doesn’t exist
-
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 ‘–threads3d’ argument when launching Katana.
- Return
- true if an override was applied, false otherwise
- Parameters
numberOfRenderThreads
-The render thread variable which is subject to the thread override
-
std::string
getKatanaBasePath
() const¶ - Return
- The base path for Katana
-
std::string
getKatanaTempDirectory
() const¶ Get the name of the temporary directory Katana creates at startup which is used throughout the session.
- Return
- Katana’s temporary directory
-
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.
- Return
- 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.
- Return
- 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.
- Return
- true if an ID pass should be created, false otherwise
- See
Render::IdSenderFactory::getNewInstance
- Note
- A better function name might be shouldRenderIDPass().
-
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.
- Return
- 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.
- Return
- true if the procedurals should be expanded, false otherwise
- See
- getRenderOutputFile
- Note
- A better function name might be shouldExpandProcedurals().
-
std::string
getRenderPluginDirectory
() const¶ Returns the directory name where the render plug-in resides on disk.
- Return
- 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.
- Return
- The value of the environment variable with the given name.
- template <typename T, typename A>
-
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);
- Return
- The typed attribute value or the default value if the attribute is not valid
- Parameters
attr
-The Attribute that we want to retrieve the value from
defaultValue
-Default value if the attribute is not valid
-
std::string
getStringAttrValue
(const FnAttribute::Attribute &attr, const std::string &defaultValue = "") const¶ A convenience function for retrieving the value of StringAttribute
- Return
- The string value contained in the attribute or the default value if the attribute is not valid
- Parameters
attr
-The StringAttribute that we want to retrieve the value from
defaultValue
-Default string value if the attribute is not valid
-
-
class
Foundry::Katana::Render::
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
-
virtual
~RenderSettings
()¶
-
virtual int
initialise
()¶ Handles the render settings attribute parsing
- Return
- A zero value if successful, a non-zero value otherwise
-
bool
isValid
() const¶ - Return
- true if the render settings have been initialised using valid renderSettings attributes, false if the renderSettings attribute is not valid.
-
virtual std::string
getCameraName
() const¶ - Return
- The camera scene graph location (renderSettings.cameraName)
-
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.
- Return
- 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.
-
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.
- Return
- 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.
- See
- CameraSettings
-
virtual void
getCropWindow
(float cropWindow[4]) const¶ The crop window corresponding to the net region of interest
- See
- getRegionOfInterest(float[4]) const.
- 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%
- Return
- The sample rate
-
virtual std::string
getResolutionName
() const¶ - Return
- The name of the resolution (renderSettings.resolution)
-
virtual int
getResolutionX
() const¶ - Return
- The render resolution width (X) (renderSettings.resolution.X)
-
virtual int
getResolutionY
() const¶ - Return
- 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()).
- Return
- The display window (0, 0, xRes, yRes)
-
virtual void
getOverscan
(int overscan[4]) const¶ - Return
- 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.
- Return
- 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.
-
virtual std::string
getRenderer
() const¶ - Return
- 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.
- Return
- true if the render thread value was set, false otherwise
- Parameters
renderThreads
-The value that will acquire the number of render threads if it has been set
-
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.
- See
- getChannelBuffers
- Parameters
outputs
-Selected interactive outputs (renderSettings.interactiveOutputs)
-
virtual void
getChannelBuffers
(ChannelBuffers &channelBuffers)¶ Provides the channel buffers for the selected interactive outputs.
- See
- getInteractiveOutputs
- Parameters
channelBuffers
-The channel buffer map which will be populated with ChannelBuffer structures that correspond to the selected interactive outputs
-
virtual RenderOutputs
getRenderOutputs
() const¶ - Return
- A map of render outputs indexed by the output name (renderSettings.outputs)
- See
- RenderOutput
-
virtual std::vector<std::string>
getRenderOutputNames
(const bool onlyEnabledOutputs = true) const¶ - Return
- The render output names in the order as they appear under (renderSettings.outputs)
-
virtual int
getNumberOfRenderOutputs
() const¶ - Return
- The number of render outputs used in disk/batch/debug renders
-
virtual RenderOutput
getRenderOutputByName
(const std::string &outputName) const¶ - Return
- ...
-
virtual int
getMaxTimeSamples
() const¶ - Return
- The maximum number of time samples (renderSettings.maxTimeSamples)
-
virtual float
getShutterOpen
() const¶ - Return
- The shutter open value (renderSettings.shutterOpen)
-
virtual float
getShutterClose
() const¶ - Return
- The shutter close value (renderSettings.shutterClose)
-
virtual bool
isTileRender
() const¶ Tile rendering is set by adding a renderSettings.tileRender attribute which contains 4 integer values.
- Return
- 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
-
virtual std::string
getRenderFinishedFilename
() const¶ - Return
- 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.
-
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.
- See
- getRenderOutputs()
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
Foundry::Katana::Render::
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
-
virtual
~ScenegraphLocationDelegate
()¶
-
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.
-
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)¶
-
virtual
-
class
Foundry::Katana::Render::
TemporaryRenderAction
¶ - #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.
Inherits from Foundry::Katana::Render::RenderAction
-
class
Foundry::Katana::RendererInfo::
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.
Subclassed by CompanyName::Katana::TemplateRendererInfoPlugin, ProfilingMockRenderer::RendererInfoPlugin
Public Types
-
typedef std::pair<std::string, FnAttribute::GroupAttribute>
OpDefinition
¶
-
typedef std::deque<OpDefinition>
OpDefinitionQueue
¶
Public Functions
-
RendererInfoBase
()¶
-
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.
- See
RendererInfo::RendererInfoBase::getRendererObjectDefaultType
- 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.
- Return
- The default renderer type (e.g. kFnRendererOutputTypeColor)
- See
RendererInfo::RendererInfoBase::fillRendererObjectTypes
- Parameters
type
-An object type (e.g. renderOutput)
-
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.
-
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.
- See
RendererInfo::RendererInfoBase::fillRendererObjectTypes
RendererInfo::RendererInfoBase::getRendererObjectDefaultType
- 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
- Return
- 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.
- Return
- The renderer version
- See
- getRegisteredRendererName
-
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).
- Return
- true if a local file is needed, false otherwise
- Parameters
outputType
-A render output type
-
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.
- Return
- true if the node type is supported, false otherwise
- Parameters
nodeType
-The node type
-
virtual bool
isPolymeshFacesetSplittingEnabled
() const¶ Declares if polymesh faces are split into sub-meshes where each mesh represents a single face-set.
- Return
- 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¶
-
virtual std::string
getRendererCoshaderType
() const¶ Specifies the shader type for coshaders if they are supported.
- Return
- The co-shader type if applicable. An empty string signifies that co-shaders are not supported.
-
virtual void
buildLiveRenderControlModules
(FnAttribute::GroupBuilder &liveRenderControlModules) const¶ Build custom live render modules for the live render tab.
- 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.
- Return
- true if the build process was successful, false otherwise.
- See
RendererInfo::RendererInfoBase::configureBasicRenderObjectInfo
- 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.
-
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).
- Return
- 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.
- Return
- 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.
- See
- 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::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.
- See
RendererInfo::RendererInfoBase::buildRendererObjectInfo
RendererInfo::RendererInfoBase::configureBasicRenderObjectInfo
- 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¶
-
const ObjectLocationsMap &
getAdditionalObjectLocations
() const¶
-
const std::vector<std::string> &
getAdditionalObjectLocations
(const std::string &type) const¶
-
typedef std::pair<std::string, FnAttribute::GroupAttribute>
-
class
Foundry::Katana::RendererInfo::
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)¶
-
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¶
-
-
class
Foundry::Katana::RendererInfo::
DiskRenderMethod
¶ - #include <RenderMethod.h>
...
Inherits from Foundry::Katana::RendererInfo::RenderMethod
Public Functions
-
DiskRenderMethod
()¶
-
DiskRenderMethod
(const std::string &name, const std::string &label)¶
-
virtual
~DiskRenderMethod
()¶
-
virtual std::string
getType
() const¶
-
virtual void
buildAttribute
(FnAttribute::GroupBuilder &builder) const¶
-
void
setAllowWaitingForRenderCompletion
(bool allowWaitingForRenderCompletion)¶
-
bool
isAllowWaitingForRenderCompletion
() const¶
Public Static Attributes
-
const char *
kType
¶
-
const char *
kDefaultLabel
¶
-
const char *
kDefaultName
¶
-
const char *
kBatchName
¶
Protected Attributes
-
bool
_allowWaitingForRenderCompletion
¶
-
-
class
Foundry::Katana::RendererInfo::
PreviewRenderMethod
¶ - #include <RenderMethod.h>
...
Inherits from Foundry::Katana::RendererInfo::RenderMethod
-
class
Foundry::Katana::RendererInfo::
LiveRenderMethod
¶ - #include <RenderMethod.h>
...
Inherits from Foundry::Katana::RendererInfo::RenderMethod
- template <typename TShaderInfoType>
-
class
Foundry::Katana::RendererInfo::
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.
- Return
- 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.
- Return
- If information about the named shader was previously cached, that info is returned. Otherwise, an empty Group Attribute.
- Parameters
shaderName
-Unique name of the shader to retreive information for.
-
ShaderInfoCache<TShaderInfoType>::Iterator
begin
() const¶ Gets a const iterator to the first Shader’s information stored in the cache.
- Return
- Const iterator to first Shader’s information cache entry.
-
ShaderInfoCache<TShaderInfoType>::Iterator
end
() const¶ Gets a const iterator to the end of the cache.
- Return
- 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.
-
typedef std::map<std::string, TShaderInfoType>::const_iterator
-
class
Foundry::Katana::RenderOutputUtils::
CameraInfo
¶ - #include <CameraInfo.h>
Public Functions
-
CameraInfo
(CameraInfoHandle handle)¶
-
~CameraInfo
()¶
-
CameraInfo
(const CameraInfo &rhs)¶
-
CameraInfo &
operator=
(const CameraInfo &rhs)¶
-
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
Foundry::Katana::RenderOutputUtils::
ProceduralOutputContextInfo
¶ - #include <FnRenderOutputUtils.h>
Public Functions
-
ProceduralOutputContextInfo
()¶
-
-
class
Foundry::Katana::RenderOutputUtils::
ShadingNodeConnectionDescription
¶ - #include <ShadingNodeConnectionDescription.h>
ShadingNodeConnectionDescription.
Public Functions
-
ShadingNodeConnectionDescription
(ShadingNodeConnectionDescriptionHandle handle)¶
-
~ShadingNodeConnectionDescription
()¶
-
ShadingNodeConnectionDescription
(const ShadingNodeConnectionDescription &rhs)¶
-
ShadingNodeConnectionDescription &
operator=
(const ShadingNodeConnectionDescription &rhs)¶
-
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
Foundry::Katana::RenderOutputUtils::
ShadingNodeDescription
¶ - #include <ShadingNodeDescription.h>
Public Functions
-
ShadingNodeDescription
(ShadingNodeDescriptionHandle handle)¶
-
~ShadingNodeDescription
()¶
-
ShadingNodeDescription
(const ShadingNodeDescription &rhs)¶
-
ShadingNodeDescription &
operator=
(const ShadingNodeDescription &rhs)¶
-
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
Foundry::Katana::RenderOutputUtils::
ShadingNodeDescriptionMap
¶ - #include <ShadingNodeDescriptionMap.h>
Public Functions
-
ShadingNodeDescriptionMap
(FnAttribute::GroupAttribute materialAttr)¶
-
ShadingNodeDescriptionMap
(FnScenegraphIterator sgIterator)¶
-
~ShadingNodeDescriptionMap
()¶
-
bool
isValid
() const¶ isValid
-
ShadingNodeDescription
getShadingNodeDescriptionByName
(const std::string &name) const¶ getShadingNodeDescriptionByName
-