Package slum :: Module shaderClasses :: Class slum
[hide private]
[frames] | no frames]

Class slum

source code

Known Subclasses:

This is the base shader class. (not used directly to develop shaders)
This class have all the support methods that that a template needs.
Also have all the client support methods.

renderer code is define as a method, as in the following example:

        def delight(self, parameters):
                return ('','')

The method must have the name of one of the renderers defined in
the _renderers method.

The method will be called by the clients, which will pass
the "parameters" attribute to it.

The parameters attribute is a dictionary that contains all the
parameters returned by the parameters method, but already evaluated
by the client. This way the method can evaluate the parameters input
from the user to build up the shader parameters and code.

The method should return a tupple, where [0] is the shader
parameters and [1] is the shader code.

Instance Methods [hide private]
 
parameters(self)
return parameters to be exposed in the client.
source code
 
icon(self)
return string with MPX icon.
source code
 
type()
slum shader type.
source code
 
__init__(self)
placeholder.
source code
 
clientRefresh(self)
placeholder.
source code
 
upload(self)
upload template to online repository.
source code
 
_renderers(self)
Returns supported renderers.
source code
 
_dictParameters(self, value=False) source code
Static Methods [hide private]
 
ID(self)
slum shader template ID.
source code
Method Details [hide private]

ID(self)
Static Method

source code 

slum shader template ID. This method MUST be overriden when developing a shader template. Every shader must have an unique ID.

parameters(self)

source code 

return parameters to be exposed in the client. This method MUST be overriden when developing a shader template.

icon(self)

source code 

return string with MPX icon. This can be overriden in the template to define a custom icon.

type()

source code 

slum shader type. This method is overriden by other classes to define the slum class type

__init__(self)
(Constructor)

source code 

placeholder. No use for this method yet

clientRefresh(self)

source code 

placeholder. Clients will override this at runtime to allow template to refresh client UI

upload(self)

source code 

upload template to online repository. It will be called by the client when the user wants to submit a template to the online repository.

_renderers(self)

source code 

Returns supported renderers. This is used by clients so they can add support on UI for then. Basically, the names here reflect the same names of the methods for each renderer. so, if you add a new renderer, you must make sure to add the method with the same name for it. also, the support for this new renderer need to be added in the clients.