shopclerks package

Submodules

shopclerks.clerkloader module

shopclerks.clerkloader.getClerkList()

shopclerks.clerkutil module

class shopclerks.clerkutil.ParmEvaluator(evaluator, precision, options, map=None)
getParmValues(parm, values)
getParmValuesArray(parm, values, count)
getRampBasis(ramp, name, values)
getRampKeys(ramp, name, values)
getRampNumKey(ramp, name, values)
getRampParms(parm, frame)
getRampValues(ramp, name, values)
getShaderParm(shadernode, frame, pname)

Returns an array of tuples (pairs of strings), representing parameter values for the given parameter names. Usually it’s just one pair, but for parms such as ramps there may be several pairs in the array. The first element of each pair is the parameter name string with qualifiers (ie, type and reference) and the second element is the string encoding of the parameter value array. Eg, [(‘“color diffuseColor”’, ‘[0.25 0.25 0.25]’)]

getShaderParms(shadernode, frame, parmnames)

Returns an array of tuples (pairs of strings), representing parameter values for the given parameter names. The first element of each pair is the parameter name string with qualifiers (ie, type and reference) and the second element is the string encoding of the parameter value array. Eg, [(‘“float diffuseGain”’, ‘[0.5]’),

(‘“color diffuseColor”’, ‘[0.25 0.25 0.25]’)]
isArrayParm(parm, n)
shopParmTupleOverride(parm, frame)
shopclerks.clerkutil.protect(pattern)

Protect special characters by replacing with expected sequences

shopclerks.clerkutil.quote(pattern)
shopclerks.clerkutil.shopParmTuple(parm, frame, options)

shopclerks.i3dclerk module

class shopclerks.i3dclerk.I3dParmEval(evaluator, precision, options, map=None)

Bases: shopclerks.clerkutil.ParmEvaluator

getParmValues(parm, values)
getRampBasis(ramp, name, values)
getRampKeys(ramp, name, values)
getRampValues(ramp, name, values)
shopclerks.i3dclerk.buildShaderString(style, shopname, time, parmnames, options)
shopclerks.i3dclerk.getKeywords()
shopclerks.i3dclerk.getLabel()
shopclerks.i3dclerk.getName()
shopclerks.i3dclerk.isVexClerk()
shopclerks.i3dclerk.shaderSupported(style)

shopclerks.ifdclerk module

class shopclerks.ifdclerk.IfdParmEval(evaluator, precision, options, map=None)

Bases: shopclerks.clerkutil.ParmEvaluator

getParmValues(parm, values)
getRampBasis(ramp, name, values)
getRampKeys(ramp, name, values)
getRampValues(ramp, name, values)
shopclerks.ifdclerk.buildShaderBounds(style, shopname, time, options)
shopclerks.ifdclerk.buildShaderString(style, shaderpath, time, parmnames, options)
shopclerks.ifdclerk.buildVopShaderString(style, shopname, vopname, time, parmnames, parmmap, vopparms, shaderinputs, options)
shopclerks.ifdclerk.creationScript(style)
shopclerks.ifdclerk.getDialogScript(style)
shopclerks.ifdclerk.getGeometryAttribute(style)
shopclerks.ifdclerk.getIndirectAttribute(style)
shopclerks.ifdclerk.getKeywords()
shopclerks.ifdclerk.getLabel()
shopclerks.ifdclerk.getName()
shopclerks.ifdclerk.isVexClerk()
shopclerks.ifdclerk.shaderSupported(style)

shopclerks.ribclerk module

class shopclerks.ribclerk.RibParmEval(evaluator, precision, options, map=None, lang='RSL')

Bases: shopclerks.clerkutil.ParmEvaluator

getParmValues(parm, values)

Takes a parameter and a string representation of the value, and returns an array of pairs (usually just one pair) whose first element is string representation of the parameter type and name and the second element is the string encoding of the parameter value. Eg, [(‘“color diffuseColor”’, ‘[0.25 0.25 0.25]’)]

getParmValuesArray(parm, values, count)
getRampBasis(ramp, name, values)
getRampKeys(ramp, name, values)
getRampNumKey(ramp, name, values)
getRampValues(ramp, name, values)
getVStructParmValues(parm, values)
isArrayParm(parm, n)
shopParmTupleOverride(parm, frame)
shopclerks.ribclerk.buildShaderBounds(style, shopname, time, options)
shopclerks.ribclerk.buildShaderString(style, shaderpath, time, parmnames, options)

Returns a string that encodes shader invocation. This includes shader name, shader parameter names, and shader parameter values. Eg, ‘“PxrSurface” “color diffuseColor” [0.25 0.25 0.25]’

shopclerks.ribclerk.buildVopShaderString(style, shopname, vopname, time, parmnames, parmmap, vopparms, shaderinputs, options)
shopclerks.ribclerk.creationScript(style)
shopclerks.ribclerk.getDialogScript(style)
shopclerks.ribclerk.getGeometryAttribute(style)
shopclerks.ribclerk.getIndirectAttribute(style)
shopclerks.ribclerk.getKeywords()
shopclerks.ribclerk.getLabel()
shopclerks.ribclerk.getName()
shopclerks.ribclerk.isVexClerk()
shopclerks.ribclerk.shaderSupported(style)

shopclerks.ribvstruct module

class shopclerks.ribvstruct.BoolExpressionValue(bool_val)

Bases: shopclerks.ribvstruct.ExpressionValue

Convenience class for representing boolean values.

class shopclerks.ribvstruct.Expression(expr_string, expr_evaluator)

Class that represents an expression object that can be evaluated.

evaluate()

Returns the evaluated expression value.

class shopclerks.ribvstruct.ExpressionParserAndDispatcher

Parses the expression and dispatches it to a registered function. The expression is in the format

function_name:argument1,argument2,argument3

A subclass must provide a binding from function_name to actual function handler by setting myFunctionMap member.

Nested expressions are allowed by using braces. Eg
outer_fn:(inner1_fn:arg11,arg12),(inner2:arg21,arg22,arg23)
this allows logical aggregators
and:(is_set:foo),(is_set:bar),(is_connected:baz)

This class implements just parsing and function call dispatching, but does not implement the actual evaluation functions, which is deferred to the subclasses.

evaluateExpression(expr_string)

Parses expr_string and dispatches a registered handle function. The handler should have just one parameter: an argument list. Returns whatever the function returns, but by convention the action functions should return an ExpressionValue object.

class shopclerks.ribvstruct.ExpressionValue(type=0, value=None)

Represents result returned by the expression evaluation functions.

CONNECTION = 2
NONE = 0
VALUE = 1
compare(other)
isTrue()

Returns true if value represents a boolean true value in some form.

type()

Returns the value’s type (kind).

value()

Returns the value’s actual Python value.

class shopclerks.ribvstruct.VStructExpressionEvaluator(node, frame)

Bases: shopclerks.ribvstruct.ExpressionParserAndDispatcher

Evaluates vstruct’s conditional expressions in Houdini.

shopclerks.ribvstruct.processVStruct(shader_node, parameter_names, frame, parameter_evaluator)

Checks the shader_node its given parameter_names for vstruct definition.

It returns a tuple:
  • first element is the array of tuples representing the connections defined by a detected vstruct. Each tuple consists of a formated parameter name (along with type and reference keyword) and parameter value string (usually a reference string). Eg, [(‘“reference color diffuseColor”’,

    ‘/shop/risnet1/pxrlayer1:pxrMaterialOut_diffuseColor’)]

  • second element is the array of parameter names that still need the caller still needs to evaluate and format into shader string. These are the parameters that are not involved in vstructs, and are to be processed in a standard way.

shader_node - the houdini node representing a shader parameter_names - array of parameter names that SOHO glue thinks

should be evaluated and formatted into a shader string. These are usually parameters that are not at default value.

frame - frame number at which parameters should be evaluated parameter_evaluator - evaluator object that can format the

parameter name and its value into a synax acceptable by renderer

Module contents