addAutomaticShaderStageInput(int, string, string, int, bool) -> bool
Add a parameter to the list of automatic input parameters for a specified
shader stage. If an input parameter with the same name or semantic is found
unconnected in a fragment graph during compilation, the parameter will be
automatically connected with a matching source, which can be either a member
in the shader stage input structure or a registered fragment, depending on
whether or not the parameter is a varying input.
The method will fail if the parameter name has been registered already. A
plug-in can add a unique prefix to the parameter name to avoid conflicts.
- shaderStage (int) - Shader stage
- parameterName (string) - Name of the parameter
- semantic (string) - Semantic of the parameter
- parameterType (int) - Type of the parameter
- isVaryingInput (bool) - Whether or not the parameter is a varying input
addDomainShaderInputNameMapping(string, string) -> bool
Add a mapping between a parameter name (realParamName) and a transient
name (domainParamName) which is used in domain shader. If realParamName
is found in the domain shader output struct when compiling a shader fragment
graph, it will temporarily be treated as domainParamName to connect to a
matching source, which can be either a member in the domain shader stage input
struct or a registered tessellation evaluation fragment, depending on whether
or not domainParamName has been registered as a varying input.
The method will fail if a mapping has already been added for realParamName.
- realParamName (string) - Real name of the parameter
- domainParamName (string) - Transient name of the parameter in domain shader
addFragmentGraphFromBuffer(buffer) -> string
Add a new fragment graph to the manager.
The fragment graph is defined as XML stored in a string buffer.Returns name of the registered fragment graph, or empty string on failure.
- buffer (string) - String containing an XML description of the fragment graph.
addFragmentGraphFromFile(fileName) -> string
Add a new fragment graph to the manager.
The fragment graph is defined as XML stored in the given file.Returns name of the registered fragment graph, or empty string on failure.
- fileName (string) - The name of the file containing the fragment graph description.
OpenMayaRender.MFragmentManager.addFragmentPath
(
)
addFragmentPath(path) -> bool
Add a path to the list of fragment search paths used when parsing the file path for any
methods which add fragments to the manager from files on disk.
addShadeFragmentFromBuffer(buffer, hidden) -> string
Add a new fragment to the manager.
The fragment is defined as XML stored in a string buffer.
Returns name of the registered fragment, or empty string on failure.
- buffer (string) - String containing an XML description of the fragment.
- hidden (bool) - If True, this fragment will not appear in the list returned by fragmentList()
and it will not be possible to query the XML for it using getFragmentXML().
addShadeFragmentFromFile(fileName, hidden) -> string
Add a new fragment to the manager.
The fragment is defined as XML stored in the given file.
Returns name of the registered fragment, or empty string on failure.
- fileName (string) - The name of the file containing the fragment description.
- hidden (bool) - If True, this fragment will not appear in the list returned by fragmentList()
and it will not be possible to query the XML for it using getFragmentXML().
findDomainShaderInputName(string) -> string
Find the transient name which is used in domain shader.
Returns transient name of the parameter, or empty string on failure.
- realParamName (string) - Real name of the parameter
OpenMayaRender.MFragmentManager.fragmentList
(
)
fragmentList() -> list of string
Returns a list of the names of all registered fragments and fragment graphs.
getEffectOutputDirectory() -> string
Get the directory to be used for effect file output.
OpenMayaRender.MFragmentManager.getFragmentXML
(
)
getFragmentXML(fragmentName) -> string
getFragmentXML(shadingNode, includeUpstreamNodes=False, objectContext=None) -> string
Get the XML representation of the named fragment or fragment graph.
Return None if failed
- fragmentName (string) - The name of the fragment to get the XML for.
Get XML code for the fragment graph Maya would use to represent the given shading node in Viewport 2.0.
Return None if failed
- shadingNode (MObject) - The node to get the XML code for.
- includeUpstreamNodes (bool) - Return the XML for the entire fragment graph rooted at the given shading node if True.
- objectContext (MDagPath) - Optional path to an instance that is associated with the shading node to provide object context.
removeAutomaticShaderStageInput(int, string) -> bool
Remove a parameter from the list of automatic input parameters for a
specified shader stage.
The method will fail if the parameter name hasn't been registered yet. A
plug-in should keep track of its own parameters and clean them up at an
appropriate time.
- shaderStage (int) - Shader stage
- parameterName (string) - Name of the parameter
removeDomainShaderInputNameMapping(string) -> bool
Remove a mapping between a parameter name (realParamName) and a transient
name (domainParamName) which is used in domain shader.
The method will fail if a mapping hasn't been added for realParamName yet.
- realParamName (string) - Real name of the parameter
OpenMayaRender.MFragmentManager.removeFragment
(
)
removeFragment(fragmentName) -> bool
Remove a named fragment or fragment graph from the fragment manager. This
can be used to remove registered fragments on plug-in unload.
Any fragment may be removed including those defined by Maya. In this way
users may replace default Maya fragments with custom fragments. When
replacing an existing Maya fragment it is important to maintain the same
fragment interface (i.e. input and output parameters) otherwise Maya's
behavior will be undefined. Maya's behavior will also be undefined if a
default Maya fragment is removed without replacing it.
Returns True if the fragment was successfuly removed from the fragment manager.