Shadetree Definitions Reference (stree.defs)

There are several ways to view into the reference guide:

What follows is the the command reference. If you find errors in the docs, please contact us via email to [email protected].


REFERENCE GUIDE

SHADETREE-DEFS(1)          Cinema Graphics, Inc.        SHADETREE-DEFS(1)

NAME
    shadetree-defs - Definition file command description

DESCRIPTION
    When ShadeTree boots, it first loads default settings from the master
    defaults file '/usr/local/shadetree/prman/stree.defs'. This file should
    not be edited by anyone.

    ShadeTree then checks for and loads the following files:

                ./stree.defs            # in the current directory
                $HOME/.stree.defs       # in your home directory

    These files may contain any commands that can be found in the master
    defaults file, and can therefore effectively override the master default
    settings, or append to them. These commands are described below.

    Note: In all cases where pathnames are specified, pathnames starting
          with '.' are assumed relative to the $cwd.  Pathnames that are
          otherwise relative (don't start with '/') are relative to $STREE_LIB
          (eg. /usr/local/shadetree/prman).

HEADING DESCRIPTIONS
--------------------
    NAME        - Shows the name of the command, and an overall syntax.

    EXAMPLE     - An actual example of the command.

    CONTEXT     - Lists the commands that this command is supposed to appear
                  within. For instance, the 'label' command creates a label
                  widget. This command is only relevant within the context
                  of the 'roe' command, so the CONTEXT for 'label' shows 'roe'.

    DESCRIPTION - A description of the command, and its usage.

    CAVEATS     - Exceptional notes of interest.


TABLE OF CONTENTS

  • 1.0.0 Render Options Editor (ROE)
  • 2.0.0 Tool Bar
  • 3.0.0 Desk Options (desk)
  • 4.0.0 Widget Window Manager Options (WWM)
  • 5.0.0 Operation Boxes Global Settings (box.*)
  • 6.0.0 Word Translations (wordtranslate.*)
  • 7.0.0 Miscellaneous Settings
  • 8.0.0 Code Generator (codegen.*)
  • 9.0.0 Data Type Constructs (datatype)


    
    


    1.0.0 Render Options Editor (ROE) The Render Options Editor is pretty flexible as of version 0.10.4; you can completely define the interface using ASCII commands in the 'roe' section of the stree.defs file. These commands define the input fields, their position in the Render Options Editor window, their default values, and the environment variables and/or action messages sent to the main program.


    1.1.0 Miscellaneous Commands


    1.1.1 roe - The ROE Construct NAME roe { roe init cmds roe context cmds } CONTEXT none DESCRIPTION Starts the definition construct for the Render Options Editor (ROE). Only roe related commands can appear within the construct. This construct defines all the data input fields in the ROE. EXAMPLE roe { # CLEAR ANY PREVIOUS WIDGETS FROM THE ROE clearall # MAIN WINDOW DIMENSIONS winwidth 381 winheight 627 # DEFINE A LABEL WIDGET label { label RENDER OPTIONS shadowtype XmSHADOW_ETCHED_OUT shadowsize 0 } # AN X/Y FIELD WIDGET xyfield { optionlabel Resolution value 256,256 separatorlabel X envname STREE_RES envseparator "," forcefloat optioncontents { 256,256 512,512 800,800 } } # OTHER WIDGETS CAN BE DEFINED HERE }


    1.1.2 winwidth - Width of dialog window NAME winwidth <pixels> EXAMPLE winwidth 320 CONTEXT roe DESCRIPTION Defines the width (in pixels) of the Render Options Editor window. It helps to use xwininfo(1) to determine the dimensions for the window after manually resizing it, and then plug those values into 'winwidth' and 'winheight'.


    1.1.3 winheight - Height of dialog window NAME winheight <pixels> EXAMPLE winheight 560 CONTEXT roe DESCRIPTION Defines the height (in pixels) of the Render Options Editor window. It helps to use xwininfo(1) to determine the dimensions for the window after manually resizing it, and then plug those values into 'winwidth' and 'winheight'.


    1.1.4 clearall - Clear all widget definitions NAME clearall CONTEXT roe DESCRIPTION Clear all input field definitions for the Render Options Editor. Usually, do this at the top of the roe definition to clear out any previous definitions. If you don't do this, any definitions will be appended to any previously defined input fields. Use 'clearall' in your ~/.stree.defs or your ./stree.defs if you want to totally redefine the Render Options Editor, rather than to append to the existing one.


    1.2.0 Field Inputs - Defining widgets


    1.2.1 label - The Label Widget Construct NAME label { label context cmds } CONTEXT roe frame DESCRIPTION The 'label' construct defines a Label widget in the current context. Examples of a label construct: # LABEL CONSTRUCT # All possible contents # label { # REQUIRED: 'label' sets the text message # label RENDER OPTIONS # OPTIONAL: 'justify' sets justification of text within the # containing Frame. Can be any of: # # left, center, right # justify center # OPTIONAL: Defines a MOTIF shadow around the label. # 'shadowtype' can be any of: # # XmSHADOW_ETCHED_IN # XmSHADOW_ETCHED_OUT # shadowtype XmSHADOW_ETCHED_OUT # OPTIONAL: 'shadowsize' specifies the size of the default # Frame around the text. If 0, no Frame is drawn. # shadowsize 0 # OPTIONAL: 'resize 0' disables auto-sizing of the # frame around the text. Default is enabled (1). resize 0 # OPTIONAL: Set 'width' if you want to specify a fixed value # (in pixels). You must use 'resize 0' first for # this command to work. # width 50 # OPTIONAL: Set 'height' if you want to specify a fixed value # (in pixels). You must use 'resize 0' first for this # command to work. # height 30 }


    1.2.2 xfield - The single value field (shading rate, zoom) NAME xfield { xfield context cmds } CONTEXT roe DESCRIPTION Defines a single field of information, complete with a chooser, text window, and help button. Values entered will be assigned as an environment variable, whose name is defined by 'envname'. Subcommands can be any of: envname <varname> - Defines the name of the environment variable the value entered will be assigned to. forcefloat - Optional. Indicates the values saved should be forced to have a decimal point. If user enters '4', the saved value will be '4.0'. nostreesave - When saving a foo.stree file, DON'T save this value's settings into it. optionlabel <text> - The label on the chooser will be set to this text string. value <text> - The initial value of this string optioncontents - The contents of the option (chooser) button { goes here, one option per line. All occur- text ances of "_SEPARATOR_" creates a separator _SEPARATOR_ bar in the popup menu. Only the first word text of each item will register into the text } window; all text following the first word is ignored. help - Defines the help text that comes up when { you click on the help button. Leading white text space is ignored. If you want to indent, } use '>'. EXAMPLE # SHADING RATE FIELD xfield { # MANDATORY: 'envname' defines the name of the environment # variable that is passed to the render script with # the value the user enters. # envname STREE_SHADERATE # MANDATORY: 'optionlabel' specifies the text that appears in the # option button. # optionlabel Shading Rate # MANDATORY: Specifies the default value for the field value 2.0 forcefloat # OPTIONAL: Specifies the contents for the popup option menu # button. When the user selects these, the value is # copied into the text window. _SEPARATOR_ may be # specified to create a 'horizontal separator bar' # in the menu, to help readability. Leading white # space is stripped. All text after the first word # is displayed, but is ignored (not copied into the # text window when selected). # optioncontents { 8.0 (fast) 4.0 2.0 _SEPARATOR_ 1.0 (norm) _SEPARATOR_ 0.75 0.50 0.25 (slow) } # OPTIONAL: Specifies the help text that appears when the user # clicks on the 'i' information help button. Leading # white space is stripped. help { Shading Rate; sets the frequency of shading a surface. Basically, higher numbers render faster. The value is an area in pixels: > 2.0 - surface is shaded once per two pixels > 1.0 - surface is shaded about once per pixel > 0.5 - surface is shaded about twice per pixel } }


    1.2.3 xyfield - The two value field (resolution) NAME xyfield { xyfield context cmds } CONTEXT roe frame DESCRIPTION Defines a double field of information, complete with a chooser, two text windows (one for each value), and help button. Values entered will be assigned as a single environment variable, whose name is defined by 'envname'. The two values are separated by the character defined in 'envseparator'. Subcommands can be any of: envseparator <text> - Optional. Defines the character that separates the two values within the single environment variable. Default is a ",". The character must be quoted. " " is allowed. envname <varname> - Defines the name of the environment variable the value entered will be assigned to. forcefloat - Optional. Indicates the values saved should be forced to have a decimal point. If user enters '4', the saved value will be '4.0'. nostreesave - When saving a foo.stree file, DON'T save this value's settings into it. optionlabel <text> - The label on the chooser will be set to this text string. separatorlabel <text> - Optional. Defines character to be displayed between the two value text windows. value <text> - The initial value of this string. Text should be quoted. optioncontents - The contents of the option (chooser) button { goes here, one option per line. All occur- text ances of "_SEPARATOR_" creates a separator _SEPARATOR_ bar in the popup menu. Only the first word text of each item will register into the text } window; all text following the first word is ignored. help - Defines the help text that comes up when { you click on the help button. Leading white text space is ignored. If you want to indent, } use '>'.


    1.2.4 xyzfield - The three value field (object rots, Frame ranges) NAME xyzfield { xyzfield context cmds } CONTEXT roe frame DESCRIPTION Defines a triple field of information, complete with a per-value chooser, three text windows (one for each value), and a help button. Values entered will be assigned as INDIVIDUAL environment variables, whose name is defined by '[xyz]envname'. headinglabel <text> - General heading title for the frame that contains the 3 values. xenvname <text> - Defines the name of the environment variable yenvname <text> the associated value is assigned to. zenvname <text> xoptionlabel <text> - Defines the text that appears in each button. yoptionlabel <text> zoptionlabel <text> xvalue <text> - Defines the default value that appears in yvalue <text> each text window, above each button. zvalue <text> forcefloat - Optional. Indicates the values saved should be forced to have a decimal point. If user enters '4', the saved value will be '4.0'. nostreesave - When saving a foo.stree file, DON'T save this value's settings into it. xoptioncontents - The contents of the option (chooser) buttons, { one option per line. All occurances of text "_SEPARATOR_" creates a separator bar in the _SEPARATOR_ popup menu. Only the first word of each item text will register into the text window; all text } following the first word is ignored. yoptioncontents { same as above } zoptioncontents { same as above } help - Defines the help text that comes up when { you click on the help button. Leading white text space is ignored. If you want to indent, } use '>'. EXAMPLE xyzfield { headinglabel Object Rotation xenvname STREE_OBJ_ROTX yenvname STREE_OBJ_ROTY zenvname STREE_OBJ_ROTZ xoptionlabel X yoptionlabel Y zoptionlabel Z xvalue 0.0 yvalue 0.0 zvalue 0.0 forcefloat xoptioncontents { "-180.0 (Upside Down)" "-90.0" " 0.0 (Front View)" " 90.0" "180.0 (Upside Down)" } yoptioncontents { "-180.0 (Back View)" "-90.0" " 0.0 (Front View)" " 90.0" "180.0 (Back View)" } zoptioncontents { "-180.0 (Upside Down)" "-90.0" " 0.0 (Front View)" " 90.0" "180.0 (Upside Down)" } help { Rotates the object around XYZ axes. } }


    1.2.5 button - Single push button NAME button { button context cmds } CONTEXT roe frame DESCRIPTION To be done. EXAMPLES button { buttonlabel Render It actionto form actionmsg render actionarg render }


    1.2.6 ledbutton - State button NAME ledbutton { ledbutton context cmds } CONTEXT roe frame DESCRIPTION To be done. nostreesave - When saving a foo.stree file, DON'T save this value's settings into it. EXAMPLES ledbutton { buttonlabel Custom Render actionto streemainwindow actionmsg custom-render-toggle-roe-noupdate envname STREE_CUSTOMREN_FLAG envon "on" envoff "off" state 0 }


    1.2.7 chooser - Single one-of-n chooser NAME chooser { chooser context cmds } CONTEXT roe frame DESCRIPTION To be done. nostreesave - When saving a foo.stree file, DON'T save this value's settings into it. EXAMPLES chooser { resize false envname STREE_OBJECT value sphere choosercontents { sphere patch cylinder corner } }


    1.2.8 okfield - The OK and DEFAULTS buttons NAME okfield { okfield context cmds } CONTEXT roe frame DESCRIPTION To be done. EXAMPLES okfield { shadowsize 4 shadowtype XmSHADOW_ETCHED_IN defaults_actionto roe defaults_actionmsg use-defaults defaults_actionarg noarg ok_actionto form ok_actionmsg roe ok_actionarg hide }


    1.2.9 stringinput - Input strings and filenames input NAME stringinput { stringinput context cmds } CONTEXT roe frame DESCRIPTION To be done. nostreesave - When saving a foo.stree file, DON'T save this value's settings into it. EXAMPLES stringinput { label Custom Render Script value bin/custom-render file 1 envname STREE_CUSTOMREN help { Sets the pathname to the custom render script. When 'Custom' button is highlighted, this is the script that is executed whenever you hit 'Render'. } }


    1.2.10 frame - A container for any of the above widgets NAME frame { { frame control commands } frame context cmds } CONTEXT roe frame DESCRIPTION To be done. EXAMPLES frame { { # THESE COMMANDS CONTROL THE FRAME shadowtype XmSHADOW_ETCHED_OUT vertical 2 shadowsize 2 } label { resize false width 20 height 10 label Shader shadowsize 0 justify right } chooser { resize false envname STREE_SHADER_TYPE value surface choosercontents { surface displace light volume } } }


    1.2.11 _SEPARATOR_ - Create a separator bar in an option or chooser menu NAME _SEPARATOR_ CONTEXT optioncontents choosercontents DESCRIPTION Creates a menu separator (a nice horizontal line) in chooser and option menus. Must be alone on a line, as if it were a single item in the option or chooser menu.


    2.0.0 Tool Bar


    2.1.1 toolbutton - defining the tool bar defaults NAME toolbutton <num>=<boxname> CONTEXT none These commands pre-program the toolbar buttons (currently 0-7) to access any of the items in the Operation Menu Bar. toolbutton 0=add toolbutton 1=subtract toolbutton 2=multiply toolbutton 3=divide toolbutton 4=negate toolbutton 5=mixed toolbutton 6=UserDefined toolbutton 7=rgb2color


    3.0.0 Desk Options (desk)


    3.1.1 desk.setbgimage - background image for the desk NAME desk.setbgimage <pathname> CONTEXT none DESCRIPTION This command should point to an .rgb or .sgi image that is to be dropped into the desk's background. This isn't used much, unless you want to drop a picture of you wife and kids into the ShadeTree interface.


    3.2.1 desk.backgroundcolor - background color NAME desk.backgroundcolor <r> <g> <b> CONTEXT none DESCRIPTION Sets the background color for the desk. Values are 0.0 to 1.0.


    3.3.1 desk.rubberbandcolor - rubberband box color NAME desk.rubberbandcolor <r> <g> <b> CONTEXT none DESCRIPTION Sets the color of the 'rubber band' line used to lasso boxes. Values are 0.0 to 1.0.


    3.4.1 desk.connectcolor - color of connect lines NAME desk.connectcolor <r> <g> <b> CONTEXT none DESCRIPTION Sets the color of the inter-connection lines between boxes. Values are 0.0 to 1.0.


    3.5.1 desk.selectedconnectcolor - color of connect lines when selected NAME desk.selectedconnectcolor <r> <g> <b> CONTEXT none DESCRIPTION Sets the color of inter-box connection lines when they are selected (clicked on with the left mouse). Values are 0.0 to 1.0.


    3.6.1 desk.showvarnames - show var. names above connect lines NAME desk.showvarnames <0|1> CONTEXT none DESCRIPTION Enables (1) or disables (0) the display of variable names next to the box connection lines. When enabled, these show the variable name associated with the connection line. Since the lines represent data flow, it sometimes helps in debugging to know which line is which.


    3.7.1 desk.zoomminmax - max/min desk zooming values NAME desk.zoomminmax <min> <max> CONTEXT none DESCRIPTION Sets bounds for the desk zoom (ALT-MIDDLE dragging), to prevent erratic behavior caused by excessive zooming.


    3.8.1 desk.linetype - style for drawing connect lines NAME desk.linetype <trace|direct> CONTEXT none DESCRIPTION Sets the mode for drawing connection lines. Normally, this is always 'trace'. Most people find it preferable to 'direct'.


    3.9.1 desk.lock - lock the desk NAME desk.lock <0|1> CONTEXT none DESCRIPTION Locks (1) or unlocks (0) the desk. When the desk is locked, you cannot add or remove boxes, you can only tweak sliders.


    3.10.1 desk.showiconimages - enable/disable icons in boxes NAME desk.showiconimages <0|1> CONTEXT none DESCRIPTION Enables (1) or disables (0) the display of icons in the boxes. When using cheap hardware, you may find disabling icons can speed up the interface's response.


    3.11.1 desk.statusbar - enable/disable the status bar NAME desk.statusbar <0|1> CONTEXT none DESCRIPTION Enables (1) or disables (0) the display of the status bar.


    3.12.1 desk.customrenderflag - enable/disable custom render script NAME desk.customrenderflag <0|1> CONTEXT none DESCRIPTION Enables (1) or disables (0) the use of the custom render script whenever the user hits the render button. When disabled, the default render script is used. In some production situations, you want this flag 'on' by default, so that you're always rendering with your custom render script.


    3.13.1 desk.boxtint - overall tint color for all boxes NAME desk.boxtint <r> <g> <b> CONTEXT none DESCRIPTION Overall tint for the boxes. These values are basically added to (offset) the RGB colors for all boxes. Negative numbers makes the channel darker, positive numbers make the channel brighter. This allows the administrator to affect the overall 'tint' of all the boxes, to match particular color schemes.


    3.14.1 desk.autosavecompiledshaderflag - not yet implemented NAME desk.autosavecompiledshaderflag CONTEXT none DESCRIPTION This command has not yet been implemented.


    4.0.0 Widget Window Manager Options (WWM) The WWM is the little Frame around all the slider widgets that is common to all the sliders; it contains the title of the window and button, the little stow, pin, and lock buttons. These are the color scheme resources, and their actual colors when the Milan color scheme is active: drawingAreaContrastColor1 - light magenta drawingAreaContrastColor2 - dark blue drawingAreaContrastColor3 - turquoise drawingAreaContrastColor4 - ugly yellow alternateBackground1 - purple alternateBackground2 - cyan alternateBackground3 - white blue alternateBackground4 - sky blue alternateBackground5 - dark blue alternateBackground6 - white gray basicBackground - always matches interface's bg color


    4.1.0 Background Color Control for the WWM


    4.1.1 bgcolor - normal bg color for the WWM NAME bgcolor <colorscheme_name> CONTEXT wwm DESCRIPTION Sets the background color for the Widget Window Manager when the slider's box is NOT selected, and when the argument editor flag is NOT set. <colorscheme_name> can be any of the 'Pre-Defined Scheme Resources' mentioned in the SGI insight(1) documentation in the 'Indigo Magic Desktop Integration Guide', but only these settings are recommended: alternateBackground1 drawingAreaContrastColor1 alternateBackground2 drawingAreaContrastColor2 alternateBackground3 drawingAreaContrastColor3 alternateBackground4 drawingAreaContrastColor4 alternateBackground5 basicBackground alternateBackground6 CAVEATS Version 0.10.5 or greater.


    4.1.2 bgcolor.arg_editor_selected - color when arg editor flag set NAME bgcolor.arg_editor_selected <colorscheme_name> CONTEXT wwm DESCRIPTION Sets the background color for the Widget Window Manager when the argument editor flag is set. This helps the user identify sliders whose values are being passed in as arguments to the shader. <colorscheme_name> can be any of the 'Pre-Defined Scheme Resources' mentioned in the SGI insight(1) documentation in the 'Indigo Magic Desktop Integration Guide', but only these settings are recommended: alternateBackground1 drawingAreaContrastColor1 alternateBackground2 drawingAreaContrastColor2 alternateBackground3 drawingAreaContrastColor3 alternateBackground4 drawingAreaContrastColor4 alternateBackground5 basicBackground alternateBackground6 CAVEATS Version 0.10.5 or greater.


    4.1.3 bgcolor.box_selected - color when box is selected NAME bgcolor.box_selected <colorscheme_name> CONTEXT wwm DESCRIPTION Sets the background color for the Widget Window Manager when the slider's box is 'selected'. This helps the user identify the sliders for the currently selected box amongst a collection of other pinned sliders. <colorscheme_name> can be any of the 'Pre-Defined Scheme Resources' mentioned in the SGI insight(1) documentation in the 'Indigo Magic Desktop Integration Guide', but only these settings are recommended: alternateBackground1 drawingAreaContrastColor1 alternateBackground2 drawingAreaContrastColor2 alternateBackground3 drawingAreaContrastColor3 alternateBackground4 drawingAreaContrastColor4 alternateBackground5 basicBackground alternateBackground6


    5.0.0 Operation Boxes Global Settings (box.*)


    5.1.1 box.selectedcolor - color when box selected NAME box.selectedcolor <r> <g> <b> CONTEXT none DESCRIPTION This sets the color of the line drawn around a box when it is selected. Values should be 0.0 to 1.0.


    5.2.1 box.selectedlinewidth - thickness of border around box NAME box.hilightedcolor <r> <g> <b> CONTEXT none DESCRIPTION When a box is highlighted (such as by the Box Finder under the 'Find' menu), it changes to this color. Values should be 0.0 to 1.0.


    5.3.1 box.hilightedcolor - color when box highlighted (menu finder) NAME box.selectedbuttoncolor <r> <g> <b> CONTEXT none DESCRIPTION When a button is selected (with the left button), it changes to this color. Values should be 0.0 to 1.0.


    5.4.1 box.selectedbuttoncolor - color when button selected NAME box.selectedlinewidth <val> CONTEXT none DESCRIPTION <val> represents the width of the line (in pixels) drawn around the box when it is selected. Values should be 0.0 to 1.0.


    5.5.1 box.connectlinewidth - width of connection lines (in pixels) NAME box.connectlinewidth <val> CONTEXT none DESCRIPTION <val> represents the width of the inter-box connection lines. Value is in pixels.


    6.0.0 Word Translations (wordtranslate.*)


    6.1.1 wordtranslate.clear - Clear all previous word translations NAME wordtranslate.clear CONTEXT none DESCRIPTION Clears all word translations previously defined with the wordtranslate.add command.


    6.2.1 wordtranslate.add - add a word translation NAME wordtranslate.add <from> <to> CONTEXT none DESCRIPTION Sets word translations for the menus, to hide the internal ShadeTree language. For instance, 'xyz' is ShadeTree's internal name for a data element that represents the three X/Y/Z values. RenderMan users would prefer to see the word 'point' in the Casts popup menu, whereas Mental Ray users would prefer to see 'miVector'. To serve this need, word translations are setup for 'xyz': wordtranslate.add xyz point # RenderMan wordtranslate.add xyz miVector # Mental Ray ShadeTree translates these words before presenting them to the user in pop up menus (for casting), etc.


    7.0.0 Miscellaneous Settings


    7.1.0 File Browsers


    7.1.1 exportoptions - File->Export Options NAME exportoptions { shadersourcefile <flag> [filename] compiledshaderfile <flag> [filename] shaderinterfacefile <flag> [filename] renderinterfacefile <flag> [filename] postsavescriptfile <flag> [filename] } [flag] - is either a 0 or 1, controlling the initial state of the toggle buttons in the export options editor, which control whether the corresponding file is saved or not, when the user selects 'File->Export All'. [filename] - sets the default directory for both the 'File->Export Options' browser, and the appropriate browser in the 'File->Export' submenu. CONTEXT none DESCRIPTION Sets the default toggle button states, and directory names for the export options editor, and the individual browsers in the 'File->Export' submenu. EXAMPLE This example might be for a Mental Ray user, who wants files to export into the appropriate directories in their Softimage chapter file hierarchy: exportoptions { shadersourcefile 1 /job/SOFTIMAGE_PROJECT/src/foo.C compiledshaderfile 1 /job/SOFTIMAGE_PROJECT/lib/foo.so shaderinterfacefile 1 /job/SOFTIMAGE_PROJECT/MATERIAL_SHADERS/foo.mat renderinterfacefile 0 postsavescriptfile 1 /job/SOFTIMAGE_PROJECT/bin/production_render.csh } SEE ALSO shadetree-operation - Section on 'Export All' shadetree-mray-faq - Section 'Is there a way to easily save out everything..?'


    7.1.2 streebrowser_dir - File->Load/Save NAME streebrowser_dir <pathname> CONTEXT none DESCRIPTION Sets the default directory for the stree file browsers, namely 'Open', and 'Save As'.


    7.1.3 imagebrowser_dir - Options->Load Background Image NAME imagebrowser_dir <pathname> CONTEXT none DESCRIPTION Sets the default directory for the background image file browser, from the Options->Load Background Image menu.


    7.1.4 stringbrowser_dir - String sliders NAME stringbrowser_dir <pathname> CONTEXT none DESCRIPTION Sets the default directory for the string slider's file browser. Each string input button has a 'slider' interface that contains a FILE browser button which, when hit, brings up this file browser.


    7.2.0 Miscellaneous


    7.2.1 customrenderscript - path to custom render script NAME customrenderscript <script pathname> CONTEXT none DESCRIPTION Points to an executable script that is invoked whenever the user hits the 'CUSTOM' render button in the render options editor, or whenever someone hits F1 or 'Render' when the custom render flag is enabled.


    7.2.2 menudir.add - path to additional menu directories NAME menudir.add <path> CONTEXT none DESCRIPTION This command allows users to define their own menu boxes, and have them appear in the interface. Defines a search path to a menu directory structure where box definition files are expected to be found, similar to the format of the /usr/local/shadetree/prman/menu directory tree. This command is cumulative; several menudir.add commands can be specified to create an entire list of search directories to be included. EXAMPLE menudir.add /usr/local/shadetree/login/shadetree/menus CAVEATS Pathnames that start with '.' work relative to the current directory. Pathnames that don't start with '.', and don't start with '/' are considered to be relative to $STREE_LIB.


    7.2.3 ext.shadersource - filename extension for shader source code NAME ext.shadersource <filename_extension> CONTEXT none DESCRIPTION Defines the filename extension to be used on all shader source code files. The leading '.' should be included. EXAMPLES ext.shadersource .sl # prman ext.shadersource .C # mray


    7.2.4 ext.compiledshader - filename extension for compiled shaders NAME ext.compiledshader CONTEXT none DESCRIPTION Defines the filename extension to be used on all compiled shader files. The leading '.' should be included. EXAMPLES ext.compiledshader .slo # prman ext.compiledshader .so # mray


    7.2.5 sourcecodeprefilter - path to script that prefilters source code NAME sourcecodeprefilter <path> CONTEXT none DESCRIPTION Points to a script or program that prefilters the source code before compiling it. Often, there are hacks in here to prepare the raw source code from ShadeTree to do various operations, such as: 1) Breaking long lines, if possible 2) Doing some code optimizations 3) Doing some code replacements/tweaks


    7.2.6 compilecmd - path to script that compiles source NAME compilecmd <path> CONTEXT none DESCRIPTION Points to a script that will compile the source code into a compiled shader. This operation is called whenever the user invokes File->Save Compiled Shader.


    7.2.7 maxhistory - Sets the maximum history size for stree files NAME maxhistory CONTEXT maxhistory 20 DESCRIPTION Sets a limit for the number of history files saved.


    8.0.0 Code Generator (codegen.*)


    8.1.0 Misc


    8.1.1 codegen.clearallvariables NAME codegen.clearallvariables CONTEXT none DESCRIPTION Clears all code generator definitions.


    8.1.2 codegen.vararg.sep NAME codegen.vararg.sep CONTEXT none DESCRIPTION Pending.


    8.2.0 Data Types


    8.2.1 codegen.rgb.declare.head - text to head declaration of variables NAME codegen.rgb.declare.head "text" CONTEXT none DESCRIPTION Tells the code generator how to lead off the declaration of RGB variables. For instance, if the desired code generator output is: color varname; \____/\_____/| | | | | | codegen.rgb.declare.tail ";" | | | Internally generated by the macro definitions. | codegen.rgb.declare.head "color "


    8.2.2 codegen.rgb.declare.tail - tail text for declaration of variables NAME codegen.rgb.declare.tail "text" CONTEXT none DESCRIPTION Tells the code generator the text to appear at the tail of RGB variables. See codegen.rgb.declare.head for an example.


    8.2.3 codegen.rgb.declareconst.head - head text for declaring constant variables NAME codegen.rgb.declareconst.head "text" CONTEXT none DESCRIPTION Tells the code generator the text to appear at the head of constant RGB declarations. For instance, if the desired code generator output is: color varname = color(1,2,3); \____/\_____/\_/\__________/| | | | | | | | | | codegen.rgb.declareconst.tail ";" | | | | | | | Internally generated by macro defs | | | | | codegen.rgb.declareconst.equal " = " | | | Internally generated by the macro definitions. | codegen.rgb.declareconst.head "color "


    8.2.4 codegen.rgb.declareconst.equal - equal text for constant variables NAME codegen.rgb.declareconst.equal "text" CONTEXT none DESCRIPTION Tells the code generator the text to appear between the varname and the initial constant value for RGB declarations. See codegen.rgb.declareconst.head for examples.


    8.2.5 codegen.rgb.declareconst.tail - tail declaration for constant variables NAME codegen.rgb.declareconst.tail "text" CONTEXT none DESCRIPTION Tells the code generator the text to appear at the tail of constant RGB declarations. See codegen.rgb.declareconst.head for examples.


    8.2.6 codegen.xyz.* - xyz data during code generation NAME codegen.xyz.* CONTEXT none DESCRIPTION Pending.


    8.2.7 codegen.float.* - float data during code generation NAME codegen.float.* CONTEXT none DESCRIPTION Pending.


    8.2.8 codegen.string.* - string data during code generation NAME codegen.string.* CONTEXT none DESCRIPTION Pending.


    8.3.0 Macro Definitions - Main Program Template


    8.3.1 codegen.global-header - the header area of the program NAME codegen.global-header [append|insert|unique] [macro text] <<EOT>> CONTEXT none DESCRIPTION Pending.


    8.3.2 codegen.main-open - the main() declaration NAME codegen.main-open [append|insert|unique] [macro text] <<EOT>> CONTEXT none DESCRIPTION Pending.


    8.3.3 codegen.main-args - the main() arguments NAME codegen.main-args [append|insert|unique] [macro text] <<EOT>> CONTEXT none DESCRIPTION Pending.


    8.3.4 codegen.main-header - the main() function header area NAME codegen.main-header [append|insert|unique] [macro text] <<EOT>> CONTEXT none DESCRIPTION Pending.


    8.3.5 codegen.main-body - the main() function body NAME codegen.main-body [append|insert|unique] [macro text] <<EOT>> CONTEXT none DESCRIPTION Pending.


    8.3.6 codegen.main-close - the end of the main() function NAME codegen.main-close [append|insert|unique] [macro text] <<EOT>> CONTEXT none DESCRIPTION Pending.


    8.3.7 codegen.global-close - the end of the program NAME codegen.global-close [append|insert|unique] [macro text] <<EOT>> CONTEXT none DESCRIPTION Pending.


    9.0.0 Data Type Constructs (datatype)


    9.1.1 datatype.clearall - clear all previously defined datatypes NAME datatype.clearall CONTEXT none DESCRIPTION Pending.


    9.1.2 datatype.add - Add a new datatype NAME datatype.add { cmds } CONTEXT none DESCRIPTION Pending. AUTHOR Greg Ercolano mailto:[email protected] COPYRIGHT (C) Copyright 1996 Cinema Graphics, Inc. All Rights Reserved. SUPPORT If you encounter errors in this document, email the author. Please supply the name of the file or manpage, enclose clippings of the erroneous text, and describe the error.


    SOURCE CODE EXAMPLE

    ####
    ####    Stree - Main Defintions
    ####
    
    # Render Options Editor: Define the interface
    roe
    {
        # CLEAR ANY PREVIOUS WIDGETS FROM THE ROE
        clearall
    
        # MAIN WINDOW DIMENSIONS
        winwidth    381
        winheight   627
    
        # HEADING
        label
        {
            label      RENDER OPTIONS
            shadowtype XmSHADOW_ETCHED_OUT
            shadowsize 0
        }
    
        # RESOLUTION FIELD
        xyfield
        {
            optionlabel      Resolution
            value            256,256
            separatorlabel   X
    
            # ENVIRONMENT NAME
            #    This is the name of the environment variable that is saved
            #    into the render_options file, or into the stree file.
            #
            envname         STREE_RES
    
            # CONTENTS FOR THE OPTION BUTTON
            #     text-xy-field expects two comma separated values
            #     followed by optional descriptive text.
            #
            optioncontents
            {
                80,80   (Small)
                100,100
                256,256
                512,512
                800,800 (Large)
            }
    
            # HELP TEXT
            #    This text appears when the user hits the 'i' help button
            #
            help
            {
                Sets the X/Y resolution of the output image.
            }
        }
    
        # SAMPLE RATE FIELD
        xfield
        {
            envname         STREE_SAMPLES
    
            optionlabel     Sample Rate
            value           2.0
            optioncontents
            {
                1.0  (fast)
                2.0  (norm)
                4.0  (slow)
                8.0
                16.0 (Real slow)
            }
            help
            {
                Sets the pixel sampling rate for the scene, as a whole.
                Larger values increase the samples per pixel.
                Basically, larger numbers take longer.
            }
        }
    
        # SHADING RATE FIELD
        xfield
        {
            envname         STREE_SHADERATE
            optionlabel     Shading Rate
            value           2.0
            optioncontents
            {
                8.0   (fast)
                4.0
                2.0
                1.0   (norm)
                0.75
                0.50
                0.25  (slow)
            }
            help
            {
                Shading Rate; sets the frequency of shading a surface.
                Basically, higher numbers render faster.
    
                The value is an area in pixels:
    
                >      2.0 - surface is shaded once per two pixels
                >      1.0 - surface is shaded about once per pixel
                >      0.5 - surface is shaded about twice per pixel
            }
        }
    
        # DISPLACEMENT BOUNDS
        xfield
        {
            envname         STREE_BOUND_DISPLACE
            optionlabel     Displace Bound
            value           off
            optioncontents
            {
                off (fast)
                0.1
                0.5
                1.0
                2.0
                4.0 (slow)
            }
            help
            {
                Sets the displacement bounding box radius.
                Basically, larger numbers render slower, but reduce
                clipping artifacts caused by large displacements.
    
                If you are displacing your object, and getting clipping artifacts,
                chances are you are displacing the object outside of the bounding
                box radius; increase the value to your maximum displacement.
            }
        }
    
        # OBJECT ZOOM
        xfield
        {
            envname         STREE_ZOOM
            optionlabel     Object Zoom
            value           4.0
            optioncontents
            {
                2.0  (Zoom In)
                3.5
                4.0  (Normal)
                5.0
                8.0
                14.0 (Zoom Out)
            }
            help
            {
                Zooms the object in or out.
                Smaller numbers zoom in.
                Larger numbers zoom out.
    
                Note that zooming in increases shading calculations,
                and can therefore greatly increase render time and memory use.
            }
        }
    
        # OBJECT ROTATION
        xyzfield
        {
            headinglabel    Object Rotation
            xenvname        STREE_OBJ_ROTX
            yenvname        STREE_OBJ_ROTY
            zenvname        STREE_OBJ_ROTZ
            xoptionlabel    X
            yoptionlabel    Y
            zoptionlabel    Z
            xvalue          0.0
            yvalue          0.0
            zvalue          0.0
            xoptioncontents
            {
                "-180.0 (Upside Down)"
                "-135.0"
                _SEPARATOR_
                "-90.0"
                "-45.0  (Pitch Bottom Towards You)"
                _SEPARATOR_
                "  0.0  (Front View)"
                _SEPARATOR_
                " 45.0  (Pitch Top Towards You)"
                " 90.0"
                _SEPARATOR_
                "135.0"
                "180.0  (Upside Down)"
            }
            yoptioncontents
            {
                "-180.0   (Back View)"
                "-135.0"
                _SEPARATOR_
                "-90.0"
                "-45.0   (Pitch Right Edge Towards You)"
                _SEPARATOR_
                "  0.0   (Front View)"
                _SEPARATOR_
                " 45.0   (Pitch Left Edge Towards You)"
                " 90.0"
                _SEPARATOR_
                "135.0"
                "180.0   (Back View)"
            }
            zoptioncontents
            {
                "-180.0  (Upside Down)"
                "-135.0"
                _SEPARATOR_
                "-90.0"
                "-45.0   (Clockwise Twist)"
                _SEPARATOR_
                "  0.0   (Front View)"
                _SEPARATOR_
                " 45.0   (Counter Clockwise Twist)"
                " 90.0"
                _SEPARATOR_
                "135.0"
                "180.0   (Upside Down)"
            }
            help
            {
                Rotates the object around XYZ axes.
                Unlike Renderman, we use 'Z towards You' positioning:
                >    X axes points to your right.
                >    Y axes points up.
                >    Z axes points towards your eye.
                These rotations follow the right hand rule:
                >    Positive X rotation pitches the top towards you.
                >    Positive Y rotation tilts the left side towards you.
                >    Positive Z rotation rolls counterclockwise.
            }
        }
    
        # LIGHT ROTATION
        xyzfield
        {
            headinglabel    Light Rotation
            xenvname        STREE_LIGHT_ROTX
            yenvname        STREE_LIGHT_ROTY
            zenvname        STREE_LIGHT_ROTZ
            xoptionlabel    X
            yoptionlabel    Y
            zoptionlabel    Z
            xvalue          -45.0
            yvalue          45.0
            zvalue          0.0
            xoptioncontents
            {
                "-180.0 (Back Light)"
                "-135.0"
                _SEPARATOR_
                "-90.0  (Top Light)"
                "-45.0"
                _SEPARATOR_
                "  0.0  (Front Light)"
                _SEPARATOR_
                " 45.0"
                " 90.0  (Bottom Light)"
                _SEPARATOR_
                "135.0"
                "180.0  (Back Light)"
    
            }
            yoptioncontents
            {
                "-180.0 (Back Light)"
                "-135.0"
                _SEPARATOR_
                "-90.0  (Left Light)"
                "-45.0"
                _SEPARATOR_
                "  0.0  (Front Light)"
                _SEPARATOR_
                " 45.0"
                " 90.0  (Right Light)"
                _SEPARATOR_
                "135.0"
                "180.0  (Back Light)"
            }
            zoptioncontents
            {
                "-180.0 (Upside Down)"
                "-135.0"
                _SEPARATOR_
                "-90.0  (Twist Clockwise)"
                "-45.0"
                _SEPARATOR_
                "  0.0  (Normal)"
                _SEPARATOR_
                " 45.0"
                " 90.0  (Twist Counter Clockwise)"
                _SEPARATOR_
                "135.0"
                "180.0  (Upside Down)"
    
            }
            help
            {
                Rotates the light around XYZ axes.
                Unlike Renderman, we use 'Z towards You' positioning:
                >   X axes points to your right.
                >   Y axes points up.
                >   Z axes points towards your eye.
                These rotations follow the right hand rule:
                >   Positive X rotation pitches light down.
                >   Positive Y rotation tilts light to the right .
                >   Positive Z rotation rolls light counter clockwise.
    
            }
        }
    
        # RENDER OPTIONS FRAME
        frame
        {
            {
                shadowtype XmSHADOW_ETCHED_OUT
                horizontal 3
            }
    
            # RENDER IT
            button
            {
                buttonlabel Render It
                actionto    form
                actionmsg   render
                actionarg   render
            }
    
            # OBJECT
            frame
            {
                {
                    shadowtype XmSHADOW_ETCHED_OUT
                    vertical   2
                    shadowsize 2
                }
                label
                {
                    resize     false
                    width      20
                    label      Object
                    shadowsize 0
                    justify    right
                }
                chooser
                {
                    resize          false
                    envname         STREE_OBJECT
                    value           sphere
                    choosercontents
                    {
                        sphere
                        patch
                        cylinder
                        corner
                    }
                }
            }
    
            # CUSTOM RENDER FLAG
            #    Sets a variable AND sends a message to the main window
            ledbutton
            {
                buttonlabel Custom Render
                actionto    streemainwindow
                actionmsg   custom-render-toggle-roe-noupdate
                envname     STREE_CUSTOMREN_FLAG
                state       0
            }
    
            # RENDER TYPE
            frame
            {
                {
                    shadowtype XmSHADOW_ETCHED_OUT
                    vertical   2
                    shadowsize 2
                }
                label
                {
                    resize     false
                    width      20
                    height     10
                    label      Shader
                    shadowsize 0
                    justify    right
                }
                chooser
                {
                    resize          false
                    envname         STREE_SHADER_TYPE
                    actionto        form
                    actionmsg       set-shadertype
                    value           surface
    
                    # NOTE: If you add to this list, be sure to add the
                    #       appropriate "ext.shaderiface <name> <ext>" commands.
                    #
                    choosercontents
                    {
                        surface
                        displace
                        light
                        volume
                    }
                }
            }
            # STOP RENDER
            button
            {
                buttonlabel STOP Render
                actionto    form
                actionmsg   render
                actionarg   kill
            }
            # ARGUMENT EDITOR
            button
            {
                buttonlabel Arg Editor
                actionto    form
                actionmsg   argeditor
                actionarg   show
            }
    
        }
    
        # OK/DEFAULTS
        okfield
        {
            shadowsize              4
            shadowtype              XmSHADOW_ETCHED_IN
            defaults_actionto       roe
            defaults_actionmsg      use-defaults
            defaults_actionarg      noarg
    
            ok_actionto             form
            ok_actionmsg            roe
            ok_actionarg            hide
        }
    
        # LIGHT COLOR
        xyzfield
        {
            headinglabel    Light Color
            xenvname        STREE_LIGHT_R
            yenvname        STREE_LIGHT_G
            zenvname        STREE_LIGHT_B
            xoptionlabel    R
            yoptionlabel    G
            zoptionlabel    B
            xvalue          1.0
            yvalue          1.0
            zvalue          1.0
            forcefloat
            xoptioncontents
            {
                "1.0"
                "0.5"
                "0.0"
            }
            yoptioncontents
            {
                "1.0"
                "0.5"
                "0.0"
            }
            zoptioncontents
            {
                "1.0"
                "0.5"
                "0.0"
            }
            help
            {
                Sets the default light color for
                shaders that use the ShadeTree default light.
                This affects the light color in all shaders
                EXCEPT light shaders, which have their own,
                separate controls.
            }
        }
    
        # CUSTOM RENDER
        stringinput
        {
            label    Custom Render Script
            value    bin/custom-render
            file     1
            envname  STREE_CUSTOMREN
            help
            {
                Sets the pathname to the custom render script.
                When 'Custom' button is highlighted, this is the script
                that is executed whenever you hit 'Render'.
            }
        }
    
        # OUTPUT IMAGE
        stringinput
        {
            label    Output Image Type
            value    screen
            file     1
            envname  STREE_OUTFILE
            help
            {
                This can either be a filename to render the images to, such as:
    
                >    /usr/tmp/foo.rgb
                >    /usr/tmp/foo.sgi
                >    /usr/tmp/foo.tiff
                >    /usr/tmp/foo.tif
                >    screen
    
                To render images to the screen, you should specify the word
                screen as the filename.
    
                The filename extensions determine what image format is used.
                Only tif/tiff, and sgi/rgb are currently supported.
            }
        }
    
    
        # FRAME RANGE
        xyzfield
        {
            headinglabel    Frame Range
            xenvname        STREE_SFRM
            yenvname        STREE_EFRM
            zenvname        STREE_IFRM
            xoptionlabel    Start
            yoptionlabel    End
            zoptionlabel    Inc
            xvalue          1
            yvalue          1
            zvalue          1
            xoptioncontents
            {
                1
            }
            yoptioncontents
            {
                1
                10
                30
                60
                100
            }
            zoptioncontents
            {
                1
                2
                4
                8
            }
            help
            {
               Sets the frame range when specifying a range of frames to render.
               The values are passed to your custom render script as a series of
               environment variables:
    
               >    STREE_SFRM     - start frame
               >    STREE_EFRM     - end frame
               >    STREE_IFRM     - increment frame
    
               If Start and End are the same value, a single frame test frame
               is rendered (the default).
            }
        }
    
        # BUCKET SIZE
        xfield
        {
            envname         STREE_BUCKET
    
            optionlabel     Bucket Size
            value           16
            optioncontents
            {
                4
                8
                16 (Normal)
                24
                32
                40
            }
            help
            {
                Sets the bucket size for rendering.
                Buckets are 'blocks of pixels' that are all computed
                at the same time. This affects render time only;
                it does not affect the resulting image.
            }
        }
    
    
        # LOAD DEFAULTS (after defining the interface)
        loaddefaults
    }
    # THESE PRE-PROGRAM THE TOOLBAR BUTTONS
    toolbutton 0=add
    toolbutton 1=subtract
    toolbutton 2=multiply
    toolbutton 3=divide
    toolbutton 4=negate
    toolbutton 5=mixed
    toolbutton 6=UserDefined
    toolbutton 7=rgb2color
    
    # DESK SETTINGS
    #desk.setbgimage                prman/icons/bg.rgb
    desk.backgroundcolor            0.37 0.51 0.54  # desk's background color
    desk.rubberbandcolor            0.8  0.30 0.40  # rubberband color for lassos
    desk.connectcolor               0.30 0.15 0.07  # connection line color
    desk.selectedconnectcolor       1.00 0.50 0.00  # selected connect line color
    desk.showvarnames               0               # 0=disable varnames, 1=enable
    #desk.zoomminmax                0.1 1.0         # 1.0 TO AVOID IMPACT SLOWNESS
    desk.zoomminmax                 0.1 2.0         # 0=unlock, 1=lock
    desk.linetype                   trace           # line type: trace || direct
    desk.lock                       0               # 0=unlock, 1=lock
    desk.showiconimages             1               # 0=disable images, 1=enable
    desk.statusbar                  1               # 0=disable status bar, 1=enable
    desk.customrenderflag           0               # 0=disable cust ren, 1=enable
    desk.autosavecompiledshaderflag 0               # 0=disable autosave, 1=enable
    desk.boxtint                    0 0 0           # overall tint for boxes (0 0 0)
                                                    # (neg numbers = darker)
    # WIDGET WINDOW MANAGER
    #    The window manager class for each slider
    #    See 'man shadetree-defs' for possible color values
    #
    wwm
    {
        bgcolor                     basicBackground
        bgcolor.arg_editor_selected alternateBackground5
        bgcolor.box_selected        alternateBackground6
    }
    
    # BOX SPECIFIC SETTINGS
    box.selectedcolor               1.0 0.9 0.8     # selected color for box
    box.hilightedcolor              1.0 1.0 1.0     # color when highlighted
    box.selectedbuttoncolor         1.0 1.0 0.5     # color when button selected
    box.selectedlinewidth           5               # selected linewidth around box
    box.connectlinewidth            3               # ??
    
    ### UNCOMMENT THESE WHEN DEMOING FOR SGI
    #desk.setbgimage                /usr/Cadmin/images/cloginlogo.rgb
    #desk.backgroundcolor           0 0 0
    #desk.connectcolor              1 1 1
    
    # EXPORT OPTIONS INITIALIZATION
    exportoptions
    {
        shadersourcefile    1 ./untitled.sl
        compiledshaderfile  1 ./untitled.slo
        shaderinterfacefile 1 ./untitled.ds
        renderinterfacefile 0 ./untitled.rib
        postsavescriptfile  0
    }
    
    # DEFAULT FILE BROWSER DIRECTORIES
    #    Users can override the defaults in their ./stree.defs or ~/.stree.defs
    #
    #    NOTE: Pathnames starting with '.' are assumed relative to the $cwd.
    #          Pathnames that are otherwise relative (dont start with '/') are
    #          relative to $STREE_LIB (eg. /usr/local/shadetree/prman).
    #
    streebrowser_dir                examples/
    # exportbrowser_dir             ./                      # OBSOLETE
    stringbrowser_dir               examples/textures/
    imagebrowser_dir                /usr/share/data/images/
    
    
    # CUSTOM RENDER SCRIPT
    #    Users can override the defaults in their ./stree.defs or ~/.stree.defs
    #
    customrenderscript              bin/custom-render
    
    # CUSTOM MENU DIRECTORIES
    #    Users can add directories to the search path, to add boxes to the menus.
    #    Uncomment as necessary. See the shadetree-menu.1 manpage for more info.
    #
    #menudir.add                    ./shadetree/menus
    
    ###
    ### CODE GENERATOR SETTINGS FOR THIS LANGUAGE CONTEXT
    ###
    #codegen.linecomment    //                      # no line comments in rman
    codegen.opencomment     /*
    codegen.closecomment    */
    
    #
    # CLEAR ALL PREVIOUS CODEGEN INTERNAL VARIABLES
    #
    codegen.clearallvariables
    codegen.vararg.sep      ,
    
    #
    # RGB DECLARATIONS
    #       color foo_bar;                  # variable declaration
    #
    codeformat.rgb.declare.head             "color "
    codeformat.rgb.declare.tail             ";"
    
    #
    # XYZ DECLARATIONS
    #       point foo_bar;                  # variable declaration
    #
    codeformat.xyz.declare.head             "point "
    codeformat.xyz.declare.tail             ";"
    
    #
    # FLOAT DECLARATIONS
    #               float foo_bar;          # variable declaration
    #
    codeformat.float.declare.head           "float "
    codeformat.float.declare.tail           ";"
    
    #
    # STRING DECLARATIONS
    #               string foo_bar;         # variable declaration
    #
    codeformat.string.declare.head          "string "
    codeformat.string.declare.tail          ";"
    
    codegen.global-open     append
    /** global-open **/
    
    /***********************************************************************
    **  _STREE_INFOSTAMP_
    ************************************************************************
    **
    **  Copyright (c) 1996 Cinema Graphics, Inc. All Rights Reserved
    **
    **  These coded instructions, statements, and computer programs  contain
    **  unpublished  proprietary  information  of Cinema Graphics, Inc., and
    **  are  protected by Federal copyright law.  They may  not be disclosed
    **  to third parties or copied or duplicated in any form, in whole or in
    **  part,  without  the  prior written consent of  Cinema Graphics, Inc.
    **
    **  This  copyright  notice  does  not evidence any  actual  or intended
    **  publication  of such trade secrets, coded instructions,  statements,
    **  and computer programs.
    **
    **  Violators of this copyright will be prosecuted to the fullest extent
    **  of the law.
    ************************************************************************/
    <<EOT>>
    
    codegen.global-header   append
    
    /** global-header **/
    <<EOT>>
    
    codegen.main-open       append
    
    /** main-open **/
    <<EOT>>
    
    codegen.main-args       append
    _STREE_MAIN_
    <<EOT>>
    
    codegen.main-args-close append
        )
    <<EOT>>
    
    codegen.main-header     append
    {
    /** main-header **/
    <<EOT>>
    
    codegen.main-body       append
    
    /** main-body **/
    <<EOT>>
    
    codegen.main-close      append
    
    /** main-close **/
    }
    <<EOT>>
    
    codegen.global-close    append
    /** global-close **/
    <<EOT>>
    
    # CAST TRANSLATIONS
    #       Translate internal names to preferred names to show to users.
    #
    wordtranslate.clear
    wordtranslate.add       rgb             color
    wordtranslate.add       xyz             point
    
    # SETUP A SOURCE CODE PREFILTER SCRIPT
    #       Script is run relative to $STREE_LIB. $1 will be the shader name.
    #       $STREE_RENOPTS will contain the path to the current render options file
    #
    sourcecodeprefilter     bin/codefilter
    
    # COMPILE SCRIPT
    #       Script to compile a 'source shader' into a 'compiled shader', as used
    #       by 'File -> Save Compiled Shader' in the main menu.
    #
    #       Path is relative to $STREE_LIB. $1 will be the shader name,
    #       $2 is the output filename.
    #
    compilecmd              bin/compileshader
    
    # GUI PREFILTER COMMAND
    #    This program accepts gui ASCII information from stdin, and is supposed to
    #    translate it into an appropriate output file (eg. .sli, .cus, etc)
    #
    #    $1 - path to the source code file. Use this to determine where to save the
    #         .sli/.cus file.
    #
    guiprefilter    bin/guiprefilter
    
    # FILE EXTENSIONS
    ext.shadersource        .sl
    ext.compiledshader      .slo
    ext.renderiface         .rib
    
    # SHADER INTERFACE FILENAME EXTENSION MAPPINGS
    #    Unlike Softimage, Renderman uses the same '.sli' extension
    #    for all shader type, so we map them all here.
    #
    ext.shaderiface surface  .sli
    ext.shaderiface displace .sli
    ext.shaderiface light    .sli
    ext.shaderiface volume   .sli
    
    # GENERIC DATATYPE
    #       Clear all previous (start from scratch)
    #
    datatype.clearall
    
    # RGBA BUILTIN DATATYPE
    datatype.add
    {
        name "rgba"
    
        declarehead       "color "
        declaretail       ";"
    }