Creating parameter UI in volumevop from vex code
2207 5 0- Niall Flinn
- Member
- 4 posts
- Joined: 5月 2013
- Offline
Hi,
I'm starting to experiment with hand coding vex to manipulate volumes, and it seems like there are a few different ways of doing it. The approach I'm working on at the moment is to create a volumevop, dive in, plug a couple of nodes together in there, then examine the resulting vex code and use that as a template for my own code.
This is generally working fine: I can modulate the density using noise( P ) and see the results in the viewport. However, I can't seem to get my script to generate any UI for parameters. I have the following pragmas at the top of my script:
#pragma export testParm all
#pragma label testParm “Test Parm”
#pragma range testParm 0 1
… and the function definition specifies a default value:
float testParm = 0;
… but all I get is the default UI, with no field, label or slider for my parameter.
What am I doing wrong? Surely I don't need to “manually” create the UI? It seems that the pragmas are there to specify the UI from within the script.
Cheers,
Niall
I'm starting to experiment with hand coding vex to manipulate volumes, and it seems like there are a few different ways of doing it. The approach I'm working on at the moment is to create a volumevop, dive in, plug a couple of nodes together in there, then examine the resulting vex code and use that as a template for my own code.
This is generally working fine: I can modulate the density using noise( P ) and see the results in the viewport. However, I can't seem to get my script to generate any UI for parameters. I have the following pragmas at the top of my script:
#pragma export testParm all
#pragma label testParm “Test Parm”
#pragma range testParm 0 1
… and the function definition specifies a default value:
float testParm = 0;
… but all I get is the default UI, with no field, label or slider for my parameter.
What am I doing wrong? Surely I don't need to “manually” create the UI? It seems that the pragmas are there to specify the UI from within the script.
Cheers,
Niall
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
- Niall Flinn
- Member
- 4 posts
- Joined: 5月 2013
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
With a Volume VOP or any VOP type context you create the interface panel from the attributes contained within. ie create a parameter or MMB on the input of the vex node inside the VOP and promote parameter .
Pure vex code wise I am normally in the otl context , where you can make a pure vex type operator. Post a scene file up and lets see where your at .
Rob
Pure vex code wise I am normally in the otl context , where you can make a pure vex type operator. Post a scene file up and lets see where your at .
Rob
Gone fishing
- Niall Flinn
- Member
- 4 posts
- Joined: 5月 2013
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
Hi,
I have taken a look , interesting approach. I must admit its a workflow I have never considered as to me the VOP context operators by default build the interface from the vex nodes inside. I do believe you could use a Vex node inside the volume vop if you are more comfortable scripting it.
From a raw scripting approach I would do the following in Houdini .
File > new operator type > select vex type and from the drop down select geometry type. name your new otl, Now you will have a pure vex operator OTL that you can use repeatedly.
See the attached file for an example. I have left the VOP way of doing things and a script version .
I have taken a look , interesting approach. I must admit its a workflow I have never considered as to me the VOP context operators by default build the interface from the vex nodes inside. I do believe you could use a Vex node inside the volume vop if you are more comfortable scripting it.
From a raw scripting approach I would do the following in Houdini .
File > new operator type > select vex type and from the drop down select geometry type. name your new otl, Now you will have a pure vex operator OTL that you can use repeatedly.
See the attached file for an example. I have left the VOP way of doing things and a script version .
Gone fishing
-
- Quick Links