Katana Plug-in APIs 0.1
Public Member Functions | Static Public Member Functions | Protected Member Functions

Foundry::Katana::RendererInfo::RendererInfoBase Class Reference

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. More...

#include <RendererInfoBase.h>

Inheritance diagram for Foundry::Katana::RendererInfo::RendererInfoBase:
CompanyName::Katana::TemplateRendererInfoPlugin ProfilingMockRenderer::RendererInfoPlugin

List of all members.

Public Member Functions

virtual void configureBatchRenderMethod (RendererInfo::DiskRenderMethod &batchRenderMethod) const =0
virtual void fillRenderMethods (std::vector< RendererInfo::RenderMethod * > &renderMethods) const =0
virtual void fillRendererObjectTypes (std::vector< std::string > &renderObjectTypes, const std::string &type) const =0
virtual std::string getRendererObjectDefaultType (const std::string &type) const
virtual void fillLiveRenderTerminalOps (OpDefinitionQueue &terminalOps, const FnAttribute::GroupAttribute &stateArgs) const
virtual void fillRenderTerminalOps (OpDefinitionQueue &terminalOps, const FnAttribute::GroupAttribute &stateArgs) const
virtual void fillRendererObjectNames (std::vector< std::string > &rendererObjectNames, const std::string &type, const std::vector< std::string > &typeTags) const =0
virtual std::string getRegisteredRendererName () const =0
virtual std::string getRegisteredRendererVersion () const =0
virtual bool isPresetLocalFileNeeded (const std::string &outputType) const
virtual bool isNodeTypeSupported (const std::string &nodeType) const
virtual bool isPolymeshFacesetSplittingEnabled () const
virtual void fillShaderInputNames (std::vector< std::string > &shaderInputNames, const std::string &shaderName) const
virtual void fillShaderInputTags (std::vector< std::string > &shaderInputTags, const std::string &shaderName, const std::string &inputName) const
virtual void fillShaderOutputNames (std::vector< std::string > &shaderOutputNames, const std::string &shaderName) const
virtual void fillShaderOutputTags (std::vector< std::string > &shaderOutputTags, const std::string &shaderName, const std::string &outputName) const
virtual std::string getRendererCoshaderType () const
virtual void buildLiveRenderControlModules (FnAttribute::GroupBuilder &liveRenderControlModules) const
virtual bool buildRendererObjectInfo (FnAttribute::GroupBuilder &rendererObjectInfo, const std::string &name, const std::string &type, const FnAttribute::GroupAttribute inputAttr) const =0
virtual void flushCaches ()
std::string getPluginPath () const
std::string getPluginRootPath () const

Static Public Member 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)

Protected Member Functions

void addRenderObjectParam (FnAttribute::GroupBuilder &renderObjectInfo, const std::string &name, int type, int arraySize, FnAttribute::Attribute defaultAttr, FnAttribute::Attribute hintsAttr, const EnumPairVector &enumValues) const
void setShaderParameterMapping (FnAttribute::GroupBuilder &renderObjectInfo, const std::string &metaName, const std::string &actualName) const
void setShaderParameterMapping (FnAttribute::GroupBuilder &renderObjectInfo, const std::string &metaName, const std::vector< std::string > &actualNames) const

Detailed Description

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:


Member Function Documentation

void Foundry::Katana::RendererInfo::RendererInfoBase::addRenderObjectParam ( FnAttribute::GroupBuilder renderObjectInfo,
const std::string &  name,
int  type,
int  arraySize,
FnAttribute::Attribute  defaultAttr,
FnAttribute::Attribute  hintsAttr,
const EnumPairVector &  enumValues 
) const [protected]

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:
renderObjectInfoThe renderer object info which contains the parameter
nameThe parameter name
typeThe parameter type (e.g. RendererObjectDefinitions::kFnRendererObjectValueTypeColor3)
arraySizeThe parameter array size (an array if the size is > 1)
defaultAttrThe default parameter value stored as a typed attribute
hintsAttrUI hints for the parameter
enumValuesEnumerated value pairs for the parameter
See also:
RendererInfo::RendererInfoBase::buildRendererObjectInfo
RendererInfo::RendererInfoBase::configureBasicRenderObjectInfo
virtual void Foundry::Katana::RendererInfo::RendererInfoBase::buildLiveRenderControlModules ( FnAttribute::GroupBuilder liveRenderControlModules) const [inline, virtual]

Build custom live render modules for the live render tab.

Parameters:
liveRenderControlModulesAttributes describing the custom live render modules.
Deprecated:
All commands, data updates, and terminal Ops required should use the LiveRenderAPI Python module.
virtual bool Foundry::Katana::RendererInfo::RendererInfoBase::buildRendererObjectInfo ( FnAttribute::GroupBuilder rendererObjectInfo,
const std::string &  name,
const std::string &  type,
const FnAttribute::GroupAttribute  inputAttr 
) const [pure virtual]

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:
rendererObjectInfoThe attributes containing the renderer object information requested by Katana.
nameThe renderer object name selected in the UI (e.g. shader name)
typeThe render object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader)
inputAttrOptional input attributes.
Returns:
true if the build process was successful, false otherwise.
See also:
RendererInfo::RendererInfoBase::configureBasicRenderObjectInfo
RendererInfo::RendererInfoBase::addRenderObjectParam
RendererInfo::RendererInfoBase::fillRendererObjectTypes

Implemented in ProfilingMockRenderer::RendererInfoPlugin, and CompanyName::Katana::TemplateRendererInfoPlugin.

static void Foundry::Katana::RendererInfo::RendererInfoBase::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 
) [static]

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

Parameters:
renderObjectInfoThe group attribute which defines the render object
typeThe render object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader)
typeTagsTags associated with the render object type (e.g. shader type)
locationThe location of the render object if applicable
fullPathThe full path of the render object
outputTypeThe output type if supported, otherwise use kFnRendererObjectValueTypeUnknown
containerHintsAn 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.
See also:
RendererInfo::RendererInfoBase::buildRendererObjectInfo
RendererInfo::RendererInfoBase::addRenderObjectParam
virtual void Foundry::Katana::RendererInfo::RendererInfoBase::configureBatchRenderMethod ( RendererInfo::DiskRenderMethod batchRenderMethod) const [pure virtual]

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:
batchRenderMethodThe batch render method.

Implemented in ProfilingMockRenderer::RendererInfoPlugin, and CompanyName::Katana::TemplateRendererInfoPlugin.

virtual void Foundry::Katana::RendererInfo::RendererInfoBase::fillLiveRenderTerminalOps ( OpDefinitionQueue &  terminalOps,
const FnAttribute::GroupAttribute stateArgs 
) const [inline, virtual]

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

Parameters:
terminalOpsThe 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.
stateArgsA 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 Foundry::Katana::RendererInfo::RendererInfoBase::fillRendererObjectNames ( std::vector< std::string > &  rendererObjectNames,
const std::string &  type,
const std::vector< std::string > &  typeTags 
) const [pure virtual]

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:
rendererObjectNamesThe names of available render objects (e.g. shader names)
typeThe render object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader)
typeTagsFilter 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.
See also:
RendererInfo::RendererInfoBase::fillRendererObjectTypes
RendererInfo::RendererInfoBase::getRendererObjectDefaultType
RendererInfo::RendererInfoBase::buildRendererObjectInfo

Implemented in ProfilingMockRenderer::RendererInfoPlugin, and CompanyName::Katana::TemplateRendererInfoPlugin.

virtual void Foundry::Katana::RendererInfo::RendererInfoBase::fillRendererObjectTypes ( std::vector< std::string > &  renderObjectTypes,
const std::string &  type 
) const [pure virtual]

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:
renderObjectTypesThe advertised types for a given renderer object type.
typeThe renderer object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader).
See also:
RendererInfo::RendererInfoBase::getRendererObjectDefaultType
RendererInfo::RendererInfoBase::fillRendererObjectNames
RendererInfo::RendererInfoBase::buildRendererObjectInfo

Implemented in ProfilingMockRenderer::RendererInfoPlugin, and CompanyName::Katana::TemplateRendererInfoPlugin.

virtual void Foundry::Katana::RendererInfo::RendererInfoBase::fillRenderMethods ( std::vector< RendererInfo::RenderMethod * > &  renderMethods) const [pure virtual]

Advertise supported render methods.

Parameters:
renderMethodsA reference container for supported render methods.
virtual void Foundry::Katana::RendererInfo::RendererInfoBase::fillRenderTerminalOps ( OpDefinitionQueue &  terminalOps,
const FnAttribute::GroupAttribute stateArgs 
) const [inline, virtual]

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

Parameters:
terminalOpsThe 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.
stateArgsA 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 Foundry::Katana::RendererInfo::RendererInfoBase::fillShaderInputNames ( std::vector< std::string > &  shaderInputNames,
const std::string &  shaderName 
) const [virtual]

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

Parameters:
shaderInputNamesThe populated input names for a given shader.
shaderNameThe name of the shader which will be populated with the input names.

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

virtual void Foundry::Katana::RendererInfo::RendererInfoBase::fillShaderInputTags ( std::vector< std::string > &  shaderInputTags,
const std::string &  shaderName,
const std::string &  inputName 
) const [virtual]

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:
shaderInputTagsThe populated input tags for a given input on a shader.
shaderNameThe name of the shader which will be populated with the input tags.
inputNameThe input name on the shader.

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

virtual void Foundry::Katana::RendererInfo::RendererInfoBase::fillShaderOutputNames ( std::vector< std::string > &  shaderOutputNames,
const std::string &  shaderName 
) const [virtual]

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

Parameters:
shaderOutputNamesThe populated output names for a given shader.
shaderNameThe name of the shader which will be populated with the output names.

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

virtual void Foundry::Katana::RendererInfo::RendererInfoBase::fillShaderOutputTags ( std::vector< std::string > &  shaderOutputTags,
const std::string &  shaderName,
const std::string &  outputName 
) const [virtual]

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:
shaderOutputTagsThe populated output tags for a given output on a shader.
shaderNameThe name of the shader which will be populated with the output tags.
outputNameThe output name on the shader.

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

virtual void Foundry::Katana::RendererInfo::RendererInfoBase::flushCaches ( ) [inline, virtual]

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

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

std::string Foundry::Katana::RendererInfo::RendererInfoBase::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 Foundry::Katana::RendererInfo::RendererInfoBase::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.
virtual std::string Foundry::Katana::RendererInfo::RendererInfoBase::getRegisteredRendererName ( ) const [pure virtual]

Registered renderer name that corresponds to this renderer info

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

Implemented in ProfilingMockRenderer::RendererInfoPlugin, and CompanyName::Katana::TemplateRendererInfoPlugin.

virtual std::string Foundry::Katana::RendererInfo::RendererInfoBase::getRegisteredRendererVersion ( ) const [pure virtual]

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

Returns:
The renderer version
See also:
getRegisteredRendererName

Implemented in ProfilingMockRenderer::RendererInfoPlugin, and CompanyName::Katana::TemplateRendererInfoPlugin.

virtual std::string Foundry::Katana::RendererInfo::RendererInfoBase::getRendererCoshaderType ( ) const [inline, virtual]

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.

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

virtual std::string Foundry::Katana::RendererInfo::RendererInfoBase::getRendererObjectDefaultType ( const std::string &  type) const [virtual]

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

See Populating renderer-specific UI parameters for more information.

Parameters:
typeAn object type (e.g. renderOutput)
Returns:
The default renderer type (e.g. kFnRendererOutputTypeColor)
See also:
RendererInfo::RendererInfoBase::fillRendererObjectTypes
RendererInfo::RendererInfoBase::fillRendererObjectNames
RendererInfo::RendererInfoBase::buildRendererObjectInfo

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

virtual bool Foundry::Katana::RendererInfo::RendererInfoBase::isNodeTypeSupported ( const std::string &  nodeType) const [inline, virtual]

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:
nodeTypeThe node type
Returns:
true if the node type is supported, false otherwise

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

virtual bool Foundry::Katana::RendererInfo::RendererInfoBase::isPolymeshFacesetSplittingEnabled ( ) const [inline, virtual]

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

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

virtual bool Foundry::Katana::RendererInfo::RendererInfoBase::isPresetLocalFileNeeded ( const std::string &  outputType) const [inline, virtual]

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

Parameters:
outputTypeA render output type
Returns:
true if a local file is needed, false otherwise

Reimplemented in CompanyName::Katana::TemplateRendererInfoPlugin.

void Foundry::Katana::RendererInfo::RendererInfoBase::setShaderParameterMapping ( FnAttribute::GroupBuilder renderObjectInfo,
const std::string &  metaName,
const std::string &  actualName 
) const [protected]

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:
renderObjectInfoThe renderer object info to modify.
metaNameThe meta name of the attribute to map an actual attribute to.
actualNameThe name of the actual attribute to map the meta attribute to.
void Foundry::Katana::RendererInfo::RendererInfoBase::setShaderParameterMapping ( FnAttribute::GroupBuilder renderObjectInfo,
const std::string &  metaName,
const std::vector< std::string > &  actualNames 
) const [protected]

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:
renderObjectInfoThe renderer object info to modify.
metaNameThe meta name of the attribute to map a list of actual attributes to.
actualNamesA list of names of the actual attributes to map the meta attribute to.

The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator