Python API 2.0 Reference: OpenMayaRender.MFragmentManager Class Reference

+ Inheritance diagram for OpenMayaRender.MFragmentManager:

Public Member Functions

__init__ ()
 
addFragmentGraphFromBuffer ()
 
addFragmentGraphFromFile ()
 
addFragmentPath ()
 
addShadeFragmentFromBuffer ()
 
addShadeFragmentFromFile ()
 
fragmentList ()
 
getEffectOutputDirectory ()
 
getFragmentXML ()
 
getIntermediateGraphOutputDirectory ()
 
hasFragment ()
 
removeFragment ()
 
setEffectOutputDirectory ()
 
setIntermediateGraphOutputDirectory ()
 

Detailed Description

Provides facilities for managing fragments for use with Viewport 2.0.

Constructor & Destructor Documentation

OpenMayaRender.MFragmentManager.__init__ ( )
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Member Function Documentation

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.
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.
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.
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().
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().
OpenMayaRender.MFragmentManager.fragmentList ( )
fragmentList() -> list of string

Returns a list of the names of all registered fragments and fragment graphs.
OpenMayaRender.MFragmentManager.getEffectOutputDirectory ( )
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.
OpenMayaRender.MFragmentManager.getIntermediateGraphOutputDirectory ( )
getIntermediateGraphOutputDirectory() -> string

Get the directory to be used for intermediate fragment graph output.
OpenMayaRender.MFragmentManager.hasFragment ( )
hasFragment(string) -> bool

Returns True if a fragment of the given name has been registered with the fragment manager.
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.
OpenMayaRender.MFragmentManager.setEffectOutputDirectory ( )
setEffectOutputDirectory(string) -> self

Set the path to use for dumping final effect files.
OpenMayaRender.MFragmentManager.setIntermediateGraphOutputDirectory ( )
setIntermediateGraphOutputDirectory(string) -> self

Set the path to use for dumping intermediate fragment graph XML files.