Python API 2.0 Reference
|
Public Member Functions | |
def | __init__ () |
def | addAutomaticShaderStageInput () |
def | addDomainShaderInputNameMapping () |
def | addFragmentGraphFromBuffer () |
def | addFragmentGraphFromFile () |
def | addFragmentPath () |
def | addShadeFragmentFromBuffer () |
def | addShadeFragmentFromFile () |
def | findDomainShaderInputName () |
def | fragmentList () |
def | getEffectOutputDirectory () |
def | getFragmentXML () |
def | getIntermediateGraphOutputDirectory () |
def | hasFragment () |
def | removeAutomaticShaderStageInput () |
def | removeDomainShaderInputNameMapping () |
def | removeFragment () |
def | setEffectOutputDirectory () |
def | setIntermediateGraphOutputDirectory () |
Static Public Member Functions | |
def | __new__ () |
Static Public Attributes | |
int | kDomainShader = 5 |
int | kGeometryShader = 2 |
int | kHullConstantShader = 4 |
int | kHullShader = 3 |
int | kPixelShader = 1 |
int | kVertexShader = 0 |
Provides facilities for managing fragments for use with Viewport 2.0.
def OpenMayaRender.MFragmentManager.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
|
static |
Create and return a new object. See help(type) for accurate signature.
def OpenMayaRender.MFragmentManager.addAutomaticShaderStageInput | ( | ) |
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
def OpenMayaRender.MFragmentManager.addDomainShaderInputNameMapping | ( | ) |
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
def OpenMayaRender.MFragmentManager.addFragmentGraphFromBuffer | ( | ) |
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.
def OpenMayaRender.MFragmentManager.addFragmentGraphFromFile | ( | ) |
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.
def 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.
def OpenMayaRender.MFragmentManager.addShadeFragmentFromBuffer | ( | ) |
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().
def OpenMayaRender.MFragmentManager.addShadeFragmentFromFile | ( | ) |
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().
def OpenMayaRender.MFragmentManager.findDomainShaderInputName | ( | ) |
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
def OpenMayaRender.MFragmentManager.fragmentList | ( | ) |
fragmentList() -> list of string Returns a list of the names of all registered fragments and fragment graphs.
def OpenMayaRender.MFragmentManager.getEffectOutputDirectory | ( | ) |
getEffectOutputDirectory() -> string Get the directory to be used for effect file output.
def 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.
def OpenMayaRender.MFragmentManager.getIntermediateGraphOutputDirectory | ( | ) |
getIntermediateGraphOutputDirectory() -> string Get the directory to be used for intermediate fragment graph output.
def OpenMayaRender.MFragmentManager.hasFragment | ( | ) |
hasFragment(string) -> bool Returns True if a fragment of the given name has been registered with the fragment manager.
def OpenMayaRender.MFragmentManager.removeAutomaticShaderStageInput | ( | ) |
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
def OpenMayaRender.MFragmentManager.removeDomainShaderInputNameMapping | ( | ) |
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
def 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.
def OpenMayaRender.MFragmentManager.setEffectOutputDirectory | ( | ) |
setEffectOutputDirectory(string) -> self Set the path to use for dumping final effect files.
def OpenMayaRender.MFragmentManager.setIntermediateGraphOutputDirectory | ( | ) |
setIntermediateGraphOutputDirectory(string) -> self Set the path to use for dumping intermediate fragment graph XML files.