Package slumMaya :: Module shaderBase :: Class AETemplate
[hide private]
[frames] | no frames]

Class AETemplate

source code

This class initialize an AETemplate for a given nodetype dinamycally. Basically this avoid the need of having an AEnodetypTemplate.mel file. When the class is created, it sources a piece of mel code that register a global proc AEnodetypeTemplate for the given nodetype. This global proc just calls the static method template of this class, where the code for the template really is, in python. Hopefully, in future versions of maya we will be able to use python directly for AETemplates.

Instance Methods [hide private]
 
__init__(self, nodeType) source code
Static Methods [hide private]
 
_layoutExists(layoutName, type)
checks for the existence of a layout with the given layoutName, of type "type" and deletes it, if it exists.
source code
 
_deleteLayoutIfExists(layoutName, type)
checks for the existence of a layout with the given layoutName, of type "type" and deletes it, if it exists.
source code
 
template(nodeName)
This is the method called by the dinamic AETemplate mel.
source code
 
customUI(nodeName)
This method is called at runtime, and its responsible to create the ui for every type of node we have.
source code
 
customUIHeader(nodeName)
this method creates generic UI that is the same for every slum shader node.
source code
 
parameters(slumNode)
This is the method that creates the UI for our attributes.
source code
Method Details [hide private]

_layoutExists(layoutName, type)
Static Method

source code 

checks for the existence of a layout with the given layoutName, of type "type" and deletes it, if it exists. Used to delete the framelayout of our template.

_deleteLayoutIfExists(layoutName, type)
Static Method

source code 

checks for the existence of a layout with the given layoutName, of type "type" and deletes it, if it exists. Used to delete the framelayout of our template.

template(nodeName)
Static Method

source code 

This is the method called by the dinamic AETemplate mel. Basically, it sets up a scroll layout, adds an extra attributes layout and suppress all attributes found in the node. The real important piece of code is the callCustom template that calls the static method customUI of this class, at runtime. Unfortunately, AGAIN we need to rely on a small portion of mel code to trigger the call for our customUI method, since a callCustom only calls mel global procs.

customUI(nodeName)
Static Method

source code 

This method is called at runtime, and its responsible to create the ui for every type of node we have. It calls genericHeader and parameters methods to initialize the generic header all slum shaders have, and the parameters for each node type, based on the returned data from the parameter of a slum class shader.

parameters(slumNode)
Static Method

source code 

This is the method that creates the UI for our attributes. The UI is based in the data returned from the parameters method of the slum class associated with the node.