Error Messages: TCLBox & RIBBox


return to main index



The preview icon (see the illustration on the right) in a SLIM window is used to preview of effect of an appearance. Unfortunately, the preview icon is of limited help when determining if the code entered into either a TCLBox or a RIBBox is correct. Almost always a spurious error message will be generated - see below.


tclbox_error

Its best to ignore such messages and check if the TCLBox and the RIBBox are OK by generating a RIB file and checking its contents. Once you are confident the TCLBox and RIBBox are working then, and only then, should you proceed to render images.


ball_icon

next >>





































THE TCLBOX

First, we must setup the TCLBox. The following screen shot shows the contents of a TCLBox,


tclbox_text

Line 1: source references a Tcl script that contains the following procedure,


# Based on the size of a bounding box the check
# procedure returns a text string containing a
# Sphere statement. A simple script, but one 
# that is adequate for the purpose of testing
# a TCLBox.
proc check { bb } {
 set rad [expr $bb * 0.5]
 set depth [expr $rad * 0.5]
 set height [expr $rad * 0.75]
return "Sphere $rad -$depth $height 360\n"
}

Line 2: the mtor Tcl procedure mattr references the width attribute of the polygonal cube to which the TCLBox is attached.

Line 3: a variable named rib is assigned the text string returned from the check procedure. This variable is automatically available to any RIBBox that is similiarly attached the cube named polyCube1.


<< prev

next >>





































THE RIBBOX

Next, the RIBBox is setup.


ribbox_text

Line 1: for convenience a Surface statement is used to assign a standard shader to the geometry that will be inserted by the $rib variable. The same effect could have been achieved by attaching an imported, or created, surface appearance to the polyCube1 shape.

Line 2: the value of the $rib variable ie. the text string "Sphere 1 -1 1 360" is made available to the RIBBox.

Line 3: the Opacity statement ensures the proxy object ie. polyCube1 is rendered as an invisible object. There are probably other ways of a "ignoring" the proxy object but using Opacity will work as long as the shader attached to the cube "responds" to opacity.

Checking the RIBBox script by clicking on the preview icon will probably generate the spurious error message shown by the screen-shot on the right - just ignore the error!





ribbox_error

<< prev

next >>





































CHECKING THE RIB FILE

To see if the TCLBox and the RIBBox are working correctly choose the custom renderer ie. notepad, using the RenderMan Controls dialog box - as shown on the right.

Render a single frame. This will generate a RIB file that will be automatically opened by notepad. Search the file looking for the text #slim ribbox ...


rib_output

If the TCLBox and the RIBBox have worked correctly you will see the text string that was generated by the check.tcl script - or whatever text your particular Tcl script produced.

Use the RenderMan Controls dialog box to return to the PRMan renderer.

Now that you have confirmed the "plumbing" is working ie. the connections between the TCLBox and the RIBBox and the proxy object in the Maya scene to which they are attached, you can edit the external Tcl script file ie. check.tcl, and be confident that you can replace the proxy object with anything you wish the renderer to produce.





globals_custom

<< prev

next >>





© 2002-4 Malcolm Kesson. All rights reserved.