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

thanks John, I think I'll submit and RFE yes.

Share this post


Link to post
Share on other sites

Hi @bunker

first I want to thank you very much, you give precious info on the forum and you helped me many times!

As regards this thread. Did you find any solution? I scripted this for myself:
http://lex.ikoon.cz/vex-ui-markup/

On the bottom of that page, there are some examples. Here is another one:

ui.thumb.gif.544a291f65fb4418144b05700b981786.gif

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks Jiri!

yes this is exactly what I was looking for - just never had the time to do it myself.
Would be great if Sidefx added this feature :lol:

  • Like 1

Share this post


Link to post
Share on other sites

I hope it may help you. The initial idea is from here, Matt Estela.

I tried to make the python scripts as clean as possible, but I have to say I am python beginner. So let me know if you get any errors, I will try to fix them asap.

It would be really easy for SESI to implement something like this, but maybe the biggest problem is to agree on the markup system, on the conventions and rules.

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

×