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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
RiOption("limits","int eyesplits",10)
- Matthias -
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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(?)
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
- Matthias -
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
RiOption("limits","int eyesplits",10)
- Matthias -
Many thanks Matthias.
Cheers
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(?)
Cheers
Surface "shader" "uniform float Ka" [ 10 ]
Sorry!
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).
- Matthias -
Many thanks Matthias, your cg toolkit is really great!!
Cheers.