Hi, I use cgkit in my own application ( that is a 3D modelling/animation package with python embedded in ), and want to export RIB with th ri module.
All works well, matrix and vector ops, but if i try to use:
RiOption("limits","eyesplits",10) , the rib is correctely written, but python reports an error.
Is there a way to correct this?
The binding checks the types of variables and as "eyesplits" is not a standard variable it generates an "error" (well, it's rather a warning) because it doesn't know its type.
To get rid of the message you have to declare the variable, either inline or using RiDeclare().
Using the inline declaration is probably the easiest solution:
- Matthias -
Many thanks Matthias.
BTW, is it possible to give to RiSurface an inline declaration ?
to output: Surface "shader" "uniform float" [ 10 ]
I haven't found how to do this.
Because if I remember RiDeclare declares parameter in global scope(?)
Surface "shader" "uniform float Ka" [ 10 ]
Yes, you can use inline declarations anywhere where parameter lists are allowed, it's not bound to specific commands.
So a call to RiSurface("shader", "uniform float Ka", 10) should do (even though in this case the declaration wouldn't be necessary as Ka is already predeclared).
Many thanks Matthias, your cg toolkit is really great!!