If so in the docs says I cant use it directly. But why not? Its just another rib files withe bounds right?
>If so in the docs says I cant use it directly.
I suppose you are referring to this sentence:
"It is not possible to use your own procedurals directly in the RIB generating program,..."
In the RenderMan API procedurals are created using the RiProcedural() call. In a C client library that comes with a renderer you could pass your own function pointers to RiProcedural() that get called during rendering.
This is not possible in a client library that only dumps RIB requests (such as in cgkit). But fortunately, the RenderMan API defines three special procedurals that can also be encoded as RIB, and that's the DelayedReadArchive, RunProgram and DynamicLoad procedurals. These actually *can* be used in Python (the above sentence from the documentation means that you can *only* use these three but not define your own Python functions that could be passed to RiProcedural()). So a DelayedReadArchive procedural is also created by calling RiProcedural() with the special "function" RiProcDelayedReadArchive. You can obtain a short help about RiProcedural() (with examples) in an interactive Python shell by calling the following:
>>> from cgkit.ri import *
Help on function RiProcedural in module cgkit.ri:
RiProcedural(data, bound, subdividefunc, freefunc)
Declare a procedural model.
Note: Here you can only use the predefined standard procedurals:
RiProcDelayedReadArchive, RiProcRunProgram, RiProcDynamicLoad.
Example: RiProcedural("mymodel.rib", [-1,1,-1,1,-1,1], \
RiProcedural(["python teapot.py",""],[0,1,0,1,0,1], \
There is also an example in the Aqsis regression test suite: http://cvs.sourceforge.net/viewcvs.py/aqsis/Testing/RIBs/Procedurals/
- Matthias -
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.