I usually use slo2otl.py to create the otl from RenderMan slo file. I want to create the menu in the UI can choose different type of the things like the vex shader, or the toggle to enable or disable the parameters. Without this I can only use numbers to switch them, not good UI.
So, Are there any way to custom the UI through this command or anyway else?
custom UI for RenderMan shader with slo2otl.py
6724 6 1- ykcosmo
- Member
- 288 posts
- Joined: July 2005
- Offline
- mark
- Staff
- 2591 posts
- Joined: July 2005
- Offline
ykcosmoOnce the .otl has been built, you can customize it by editing the type properties.
I usually use slo2otl.py to create the otl from RenderMan slo file. I want to create the menu in the UI can choose different type of the things like the vex shader, or the toggle to enable or disable the parameters. Without this I can only use numbers to switch them, not good UI.
So, Are there any way to custom the UI through this command or anyway else?
But, if you need to remake the OTL, you will most likely lose your changes.
The alternative, is to include pragmas in your code and declare the function & arguments as a VEX function (in addition to the RSL function). Then you can generate the .otl using the VEX compiler (vcc). This tends to make the shader code a little harder to read though.
For example:
#pragma rendermask RIB
#pragma label red “The Red Parameter”
#pragma hint red color
#if defined(__vex)
surface flatred(vector red={1,0,0}) {}
#else
surface
flatred(color red=color(1,0,0))
{
Ci = red;
}
#endif
Then compile with vcc:
% vcc -l flatred.otl flatred.sl
- ykcosmo
- Member
- 288 posts
- Joined: July 2005
- Offline
It works, thank you !
And I tried to make the toggle, it worked but there was a warming:
S31003 {WARNING} RIB value for “x” in shader “flatred” on gprim “/obj/platonic_object1” was not declared.
Here is my sl code:
#pragma rendermask RIB
#pragma label red “The Red Parameter”
#pragma hint red color
#pragma label x “toggle blue”
#pragma hint x toggle
#if defined(__vex)
surface flatred(vector red={1,0,0}; float x = 0) {}
#else
surface
flatred(color red = color (1,0,0); float x = 0)
{
color blue = color (0,0,1);
Ci = red + x * blue;
}
#endif
Also, this is not the best to make toggle parameter, I tried to use if {}but doesn't work.
Could you make a toggle example?
And I tried to make the toggle, it worked but there was a warming:
S31003 {WARNING} RIB value for “x” in shader “flatred” on gprim “/obj/platonic_object1” was not declared.
Here is my sl code:
#pragma rendermask RIB
#pragma label red “The Red Parameter”
#pragma hint red color
#pragma label x “toggle blue”
#pragma hint x toggle
#if defined(__vex)
surface flatred(vector red={1,0,0}; float x = 0) {}
#else
surface
flatred(color red = color (1,0,0); float x = 0)
{
color blue = color (0,0,1);
Ci = red + x * blue;
}
#endif
Also, this is not the best to make toggle parameter, I tried to use if {}but doesn't work.
Could you make a toggle example?
^_^
- mark
- Staff
- 2591 posts
- Joined: July 2005
- Offline
- ykcosmo
- Member
- 288 posts
- Joined: July 2005
- Offline
- mark
- Staff
- 2591 posts
- Joined: July 2005
- Offline
- ykcosmo
- Member
- 288 posts
- Joined: July 2005
- Offline
very odd….
I put them in the same directory as my hip is, also I assigned the shader path as $HIP with the default path.
I tried it again, re-complied the shader and otl. I got the magenta color when I toggle the blue, so the shader works, but still get that warning, very odd…
Please see my attachment, I put the hip, sl, and otl in it.
I was running mac OSX 10.6.1 with houdini 10.0.401.
I put them in the same directory as my hip is, also I assigned the shader path as $HIP with the default path.
I tried it again, re-complied the shader and otl. I got the magenta color when I toggle the blue, so the shader works, but still get that warning, very odd…
Please see my attachment, I put the hip, sl, and otl in it.
I was running mac OSX 10.6.1 with houdini 10.0.401.
^_^
-
- Quick Links