It is safe to import the module using
from cgkit.ri import *
All the functions that get imported start with the prefix Ri,
all constants start with RI_ or RIE_, so you probably
won't get into a naming conflict.
After importing the module this way you can use the functions just as you're used to from the C API (well, almost).
from cgkit.ri import *
RiBegin(RI_NULL)
RiWorldBegin()
RiSurface("plastic")
RiSphere(1,-1,1,360)
RiWorldEnd()
RiEnd()
The parameter to RiBegin() determines where the output is directed to. You can pass one of the following:
RI_NULL or an empty string: The RIB stream will be written to
stdout.
".rib" (case insensitive):
A file with the given name is created and the RIB stream is written into it.
".rib.gz" (case insensitive):
Same as before, but the stream is compressed. The result is the same as if you
would output a RIB file and then compress it using gzip.
".rib" or ".rib.gz": The name
is supposed to be an external program that reads RIB from stdin.
The program is launched and the RIB stream is piped into it.
Note: When using the cri module you first have to load a library and invoke the functions on the returned handle (see the section on the cri module for more information about that). The interpretation of the argument to RiBegin() is then dependent on the renderer you are using.