FreeMat: vtkRIBExporter

FreeMat

- Main Page
- Related Pages

vtkRIBExporter

Section: Visualization Toolkit Hybrid Classes

# Usage

vtkRIBExporter is a concrete subclass of vtkExporter that writes a Renderman .RIB files. The input specifies a vtkRenderWindow. All visible actors and lights will be included in the rib file. The following file naming conventions apply: rib file - FilePrefix.rib image file created by RenderMan - FilePrefix.tif texture files - TexturePrefix_0xADDR_MTIME.tif This object does NOT generate an image file. The user must run either RenderMan or a RenderMan emulator like Blue Moon Ray Tracer (BMRT). vtk properties are convert to Renderman shaders as follows: Normal property, no texture map - plastic.sl Normal property with texture map - txtplastic.sl These two shaders must be compiled by the rendering package being used. vtkRIBExporter also supports custom shaders. The shaders are written using the Renderman Shading Language. See "The Renderman Companion", ISBN 0-201-50868, 1989 for details on writing shaders. vtkRIBProperty specifies the declarations and parameter settings for custom shaders. Tcl Example: generate a rib file for the current rendering. vtkRIBExporter myRIB myRIB SetInput $renWin myRIB SetFIlePrefix mine myRIB Write This will create a file mine.rib. After running this file through a Renderman renderer a file mine.tif will contain the rendered image.

To create an instance of class vtkRIBExporter, simply invoke its constructor as follows

      obj = vtkRIBExporter

# Methods

The class vtkRIBExporter has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkRIBExporter class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkRIBExporter = obj.NewInstance ()`
- `vtkRIBExporter = obj.SafeDownCast (vtkObject o)`
- `obj.SetSize (int , int )`
- `obj.SetSize (int a[2])`
- `int = obj. GetSize ()`
- `obj.SetPixelSamples (int , int )`
- `obj.SetPixelSamples (int a[2])`
- `int = obj. GetPixelSamples ()`
- `obj.SetFilePrefix (string )` - Specify the prefix of the files to write out. The resulting file names will have .RIB appended to them.
- `string = obj.GetFilePrefix ()` - Specify the prefix of the files to write out. The resulting file names will have .RIB appended to them.
- `obj.SetTexturePrefix (string )` - Specify the prefix of any generated texture files.
- `string = obj.GetTexturePrefix ()` - Specify the prefix of any generated texture files.
- `obj.SetBackground (int )` - Set/Get the background flag. Default is 0 (off). If set, the rib file will contain an image shader that will use the renderer window's background color. Normally, RenderMan does generate backgrounds. Backgrounds are composited into the scene with the tiffcomp program that comes with Pixar's RenderMan Toolkit. In fact, Pixar's Renderman will accept an image shader but only sets the alpha of the background. Images created this way will still have a black background but contain an alpha of 1 at all pixels and CANNOT be subsequently composited with other images using tiffcomp. However, other RenderMan compliant renderers like Blue Moon Ray Tracing (BMRT) do allow image shaders and properly set the background color. If this sounds too confusing, use the following rules: If you are using Pixar's Renderman, leave the Background off. Otherwise, try setting BackGroundOn and see if you get the desired results.
- `int = obj.GetBackground ()` - Set/Get the background flag. Default is 0 (off). If set, the rib file will contain an image shader that will use the renderer window's background color. Normally, RenderMan does generate backgrounds. Backgrounds are composited into the scene with the tiffcomp program that comes with Pixar's RenderMan Toolkit. In fact, Pixar's Renderman will accept an image shader but only sets the alpha of the background. Images created this way will still have a black background but contain an alpha of 1 at all pixels and CANNOT be subsequently composited with other images using tiffcomp. However, other RenderMan compliant renderers like Blue Moon Ray Tracing (BMRT) do allow image shaders and properly set the background color. If this sounds too confusing, use the following rules: If you are using Pixar's Renderman, leave the Background off. Otherwise, try setting BackGroundOn and see if you get the desired results.
- `obj.BackgroundOn ()` - Set/Get the background flag. Default is 0 (off). If set, the rib file will contain an image shader that will use the renderer window's background color. Normally, RenderMan does generate backgrounds. Backgrounds are composited into the scene with the tiffcomp program that comes with Pixar's RenderMan Toolkit. In fact, Pixar's Renderman will accept an image shader but only sets the alpha of the background. Images created this way will still have a black background but contain an alpha of 1 at all pixels and CANNOT be subsequently composited with other images using tiffcomp. However, other RenderMan compliant renderers like Blue Moon Ray Tracing (BMRT) do allow image shaders and properly set the background color. If this sounds too confusing, use the following rules: If you are using Pixar's Renderman, leave the Background off. Otherwise, try setting BackGroundOn and see if you get the desired results.
- `obj.BackgroundOff ()` - Set/Get the background flag. Default is 0 (off). If set, the rib file will contain an image shader that will use the renderer window's background color. Normally, RenderMan does generate backgrounds. Backgrounds are composited into the scene with the tiffcomp program that comes with Pixar's RenderMan Toolkit. In fact, Pixar's Renderman will accept an image shader but only sets the alpha of the background. Images created this way will still have a black background but contain an alpha of 1 at all pixels and CANNOT be subsequently composited with other images using tiffcomp. However, other RenderMan compliant renderers like Blue Moon Ray Tracing (BMRT) do allow image shaders and properly set the background color. If this sounds too confusing, use the following rules: If you are using Pixar's Renderman, leave the Background off. Otherwise, try setting BackGroundOn and see if you get the desired results.
- `obj.SetExportArrays (int )` - Set or get the ExportArrays. If ExportArrays is set, then all point data, field data, and cell data arrays will get exported together with polygons.
- `int = obj.GetExportArraysMinValue ()` - Set or get the ExportArrays. If ExportArrays is set, then all point data, field data, and cell data arrays will get exported together with polygons.
- `int = obj.GetExportArraysMaxValue ()` - Set or get the ExportArrays. If ExportArrays is set, then all point data, field data, and cell data arrays will get exported together with polygons.
- `obj.ExportArraysOn ()` - Set or get the ExportArrays. If ExportArrays is set, then all point data, field data, and cell data arrays will get exported together with polygons.
- `obj.ExportArraysOff ()` - Set or get the ExportArrays. If ExportArrays is set, then all point data, field data, and cell data arrays will get exported together with polygons.
- `int = obj.GetExportArrays ()` - Set or get the ExportArrays. If ExportArrays is set, then all point data, field data, and cell data arrays will get exported together with polygons.