rmands module

class rmands.ArgsOutput(outputType, outputName)

Args output object

class rmands.RslMethod(rsl_return, rsl_name, rsl_isvariadic=False, rsl_arguments=None, rsl_help=None)

An RslMethod object describes an RSL method on a class.

save(fp, indent='')

Save the method in the json format used in the VopTypeDefinitions file.

setHelp(rsl_help)

Accessory method to set the help for the parameter.

class rmands.RslParm(rsl_type, rsl_name, rsl_default=None, rsl_arraysize=1, rsl_help=None, ui_page=None, inputType=None, connectable=True, rsl_min=None, rsl_max=None, hideRule=None, isRamp=False, rampParmTags=([], {}))

An RslParm object describes the RSL parameter used in a shader. The parameter default should always be a list object (even for scalars).

getDisableOp(opName)
getHideOp(opName)
isShaderParm()

Method to determine if the parameter is a shader parameter

numberToString(number)
processDisableRule(hintdict)
processHideRule(hintdict)
save(fp, indent='', ds=None)

Save the parameter in the format used by Houdini dialog script files.

Ensure that the parmtag storing the RSL type information is saved as well.

saveMultiparm(fp, parmName, parmLabel, indent='')
setArraySize(size)

Accessor method to set the array size for the parameter.

setDefault(value)

Accessor method to set the default value for the parameter.

setDisableRule(lockOp, lockPath, lockValue)

Accessory method to set the disable-when rule.

setHelp(rsl_help)

Accessory method to set the help for the parameter.

setHideRule(visOp, visPath, visValue)

Accessory method to set the hide-when rule.

setLabel(label)

The label shows up as the UI label for the parameter and may be different than the parameter name.

setMax(value)

The max value for the parameter

setMin(value)

The min value for the parameter

setMultipleDisableRule(lockOp1, lockPath1, lockValue1, lockOp, lockOp2, lockPath2, lockValue2)

Accessory method to set the multiple disable-when rule.

setMultipleHideRule(visOp1, visPath1, visValue1, visOp, visOp2, visPath2, visValue2)

Accessory method to set the multiple hide-when rule.

setUI(ui_type, meta)

Accessory method to set the Houdini UI widget.

setVisibility(vis)

Accessory method to set the visibility state.

class rmands.RslShader(shader_type, shader_name, shader_path=None)

The RslShader class stores the information about a shader. This consists of

shader_type = RSL shader type (i.e. “surface”, “light”) shader_name = The name of the shader (i.e. “plastic”)
The shader has additional attributes which can be set
Label = The text which appears in the SHOP menu Help = A help string Icon = The icon used on the SHOP tile

After the shader is constructed, parameters may be added.

addMethod(method)

Add a method.

addOutput(output)

Add output

addParm(parm)

Add a parameter. The parameter should be an RslParm

addToOTL(otl_path, force=True)

This method will add the shader definition to an OTL.

If the OTL already contains a definition for the shader, the force parameter can be used to ensure that this shader is included (instead of leaving the previous definition). This is the default behaviour.

beginPage(pageName)

Each page is stored as a (list,dict) tuple. Child pages names are stored as a string in the list of the parent (the child page’s name) and the child page itself is then stored in the dict of its parent. The dict has a pointer back to its parent node which is a tuple of (parentpage, ‘child name’)

endPage()
getPagePath(page)

build a pathname to the current page replacing spaces with _ and using _ as a joining char

isValid()

The RSL shader is only valid if there’s a corresponding SHOP type for the shader.

makeOTL(otl_path)

An OTL consists of several components. The most important for SHOPs is the dialog script (which defines the UI).

This part of the program relies on being able to create an expanded view of the OTL (consisting of all the components).

When the expanded view has been created, the “hotl” application is invoked to bundle the components into the OTL.

saveDialogScript(fp)

Save the dialog script to the file passed in. This is the primary component of the OTL.

savePage(fp, pageName, node, indent='')
saveRampParmTags(fp, parmName, indent='')
saveRoot(fp, node, indent='')
saveVopTypeDefinitions(fp)

Save the vop type defintions file. This file allows other classes to introspect methods on the shader class.

setHelp(help)

Set the help for the SHOP. The help should be an array of strings. Each element of the array will be a separate line of help text. For example:

shader.setHelp([“line one”, “line two”])

setIcon(icon)

Set the icon for the SHOP

setLabel(label)

Set the label (text which shows up in the SHOP menu) for the shader.

setName(name)

Set operator name (overriding shader name for some reason)

setPath(path)

Set the path (text to resolve the shader in rib)