Creating parameter UI in volumevop from vex code

   2205   5   0
User Avatar
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
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
Hi
It looks correct, try below


// define the label interface
#pragma label grndcolor “Ground Color”

// define variables
mystuff(
vector grndcolor = {0.52,0.458,0.328};
)

Rob

Rob
Gone fishing
User Avatar
Member
4 posts
Joined: 5月 2013
Offline
Hi Rob,

That's what I'm already doing, but the volumevop doesn't seem to want to create the UI. Is there something special about that context? What kind of node does your code run in?

Cheers,

N
User Avatar
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

Attachments:
rse_vop.hip (62.1 KB)

Gone fishing
User Avatar
Member
4 posts
Joined: 5月 2013
Offline
Thanks!

Here's a hip file and a script to load into the vop… currently it's pointing to a location in my home directory. Oh, and the script has a .txt file extension, as the forum won't allow me to upload it with the .vfl extension.

Niall

Attachments:
test.txt (2.1 KB)
volume_vop_example.hip (92.1 KB)

User Avatar
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 .

Attachments:
rse_test_vex_geoop_v001.otl (3.9 KB)
rse_volume_examples.hip (113.3 KB)

Gone fishing
  • Quick Links