Jump to content
bunker

wrangle nodes pragma?

Recommended Posts

Does anyone knows if it's possible to define the UI of Wrangle nodes using some kind of vex #pragma?

Share this post


Link to post
Share on other sites

you can define UI by code like

@myparm = ch("mychannel");

this will reference a float channel named "mychannel". the slider value will be then picked as an input value for associated parameter "myparm"

referenced channels are created by clicking on "Create spare parameters for each unique call" (located by the right side of the vex editor window).

for other kinds of UI you can use functions chramp (for ramps), chi (for integer channel), etc...

 

Share this post


Link to post
Share on other sites

I meant for more advanced UI definition, eg: setting the default values of parameters, min/max ranges, name of parameters in the UI,... 
something like pragmas, but the wangle equivalent, if that exists:

#pragma range seed    0 10
#pragma label amp    "Noise Amplitude"
#pragma hint __nondiffuse toggle // Define as a toggle button

Share this post


Link to post
Share on other sites

...but typically you can do everything you need via Edit Parameter Interface dialog and saving node presets. pragmas are used mostly when you're writing shaders or that kind of low level stuff.

Share this post


Link to post
Share on other sites

If you look at 

$HFS/houdini/python2.7libs/vexpressionmenu.py

This is the the script they use to build the parameters by calling 

vexpressionmenu.buildSnippetMenu('attribwrangle/snippet')

It might be possible to expand on their code to fit your needs, or submit an RFE for more capabilities to be added to this function beyond channel data type detection.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×