|
Katana Plug-in APIs 0.1
|
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>
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 |
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.
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:
| 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.
| 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 |
| virtual void Foundry::Katana::RendererInfo::RendererInfoBase::buildLiveRenderControlModules | ( | FnAttribute::GroupBuilder & | liveRenderControlModules | ) | const [inline, virtual] |
Build custom live render modules for the live render tab.
| liveRenderControlModules | Attributes describing the custom live render modules. |
| 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.
| 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. |
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.
| 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. |
| 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.
| batchRenderMethod | The 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.
| 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:
|
| 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.
| 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. |
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:
See Populating renderer-specific UI parameters for more information.
| renderObjectTypes | The advertised types for a given renderer object type. |
| type | The renderer object type (e.g. RendererObjectDefinitions::kFnRendererObjectTypeShader). |
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.
| renderMethods | A 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.
| 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:
|
| 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.
| shaderInputNames | The populated input names for a given shader. |
| shaderName | The 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");
| 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. |
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.
| shaderOutputNames | The populated output names for a given shader. |
| shaderName | The 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");
| 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. |
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).
| 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.
| virtual std::string Foundry::Katana::RendererInfo::RendererInfoBase::getRegisteredRendererName | ( | ) | const [pure virtual] |
Registered renderer name that corresponds to this renderer info
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.
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.
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.
| type | An object type (e.g. renderOutput) |
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.
| nodeType | The node type |
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.
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).
| outputType | A render output type |
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.
| 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 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.
| 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. |
1.7.3