User guide
147
Args Files for Render Procedurals
Similar to their use in shader interfaces, UI hints can be defined for PRMan and Arnold procedurals. The
RendererProceduralArgs node looks for an .args file called <proceduralName>.so.args in the same directory as the
.so file for the procedural.
In contrast to their use with Shaders, Args files for a procedural must specify a default value for each parameter, as
shown in the procedural.so.args file below:
<args format="1.0" outputStyle="typedArguments">
<int name='count' default='100'/>
<int name='segments' default='3'/>
<float name='rootWidth' default='0.04'/>
<float name='tipWidth' default='0.00'/>
<float name='lengthMin' default='0.4'/>
<float name='lengthMax' default='1.3'/>
<float name='turnsMin' default='0.5'/>
<float name='turnsMax' default='2.0'/>
<float name='radiusMin' default='0.06'/>
<float name='radiusMax' default='0.09'/>
<float name='min_pixel_width' default='1.0'/>
</args>
Parameters are parsed from Args file to procedural as either serialized key-value pairs, or typed arguments. If the
Args file does not specify an output style, it defaults to serialized key-value pairs.
Serialized Key-Value Pairs Examples
If an Args files does not specify an output style, parameters are output to the procedural as serialized key-value
pairs. In which case, all parameters are read into a string variable, which must be tokenized to extract individual
parameters. In the case of the PRMan procedural extract shown below, the expected parameters are an array of
RtColor, and a float.
struct MyParams
{
RtColor csValues[4];
float radius;
MyParams(RtString paramstr)
: radius(1.0f)
{
printf("paramstr: %s\n", paramstr);
//initialize defaults
20 ARGS FILES IN SHADERS | EDIT SHADER INTERFACE INTERACTIVELY IN THE UI