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

Class delight

source code


this class defines all the static methods that shaderBase calls to correct implement
the 3delight support in slum nodes.
this class need to be registered in slumMaya.renderers, so shaderBase can know about it.
to register a new renderer class, just do :
        slumMaya.renderers.append(class name)

Instance Methods [hide private]
 
__init__(self, node)
initialize the delight class to be used in idle events, for example, to render swatch using the _renderPreview method.
source code
 
_translateShader(self, compile=True) source code
 
_renderPreview(self)
this method is called by slum node AETemplate to render a swatch image.
source code
Static Methods [hide private]
 
slumInitializer(node)
This method is called by shaderBase when initializing parameters for a slum node.
source code
 
setInternalValueInContext(plugName, node, dataHandle)
This method is called by shaderBase when setting parameters of a slum node.
source code
 
getInternalValueInContext(plugName, node, dataHandle)
This method is called by shaderBase when querying parameters of a slum node.
source code
 
swatchUI(node)
this method is called by slum node AETemplate to display a swatch images.
source code
 
_imageControlName(node) source code
Method Details [hide private]

slumInitializer(node)
Static Method

source code 

This method is called by shaderBase when initializing parameters for a slum node. slum is implemented in 3delight for maya as a rsl code node. shadingParameters and shadingCode are the attributes that 3dfm looks for in an rsl code node. we also set the attributes as "setInternal=True", which triggers maya to call our getInternalValueInContext method everytime someone tries to read this parameters. So, the only thing we do is hook some code into getInternalValueInContext to gather parameters and code from the slum class and return to maya, dynamically.

setInternalValueInContext(plugName, node, dataHandle)
Static Method

source code 

This method is called by shaderBase when setting parameters of a slum node. you can use this to automatically call the swatch method to render a swatch when an attribute is changed.

getInternalValueInContext(plugName, node, dataHandle)
Static Method

source code 

This method is called by shaderBase when querying parameters of a slum node. slum is implemented in 3delight for maya as renderman shader code nodes. It have a shadingParameters and shadingCode attributes that 3delight for maya will query to get the rsl shader parameters and code for a shader. This method grabs the parameters and code from the slum class and return to 3delight for maya dinamically.

swatchUI(node)
Static Method

source code 

this method is called by slum node AETemplate to display a swatch images. it should contain all the code to display swatch images inside slum node AETemplate. Whith this method, its very easy to create diferent types of swatch preview layouts, depending on the renderer.

_renderPreview(self)

source code 

this method is called by slum node AETemplate to render a swatch image. everytime an attribute is changed, shaderBase class will call this method to render a new swatch for the node.