Is it possible to add more VEX Presets to Wrangle nodes?

   9843   10   7
User Avatar
Member
833 posts
Joined: Jan. 2018
Offline
Just wondering if anyone knows how it might be possible to add more pre-coded VEX presets to the various Wrangle nodes in addition to the limited number which are already there?

If this is not possible, then I would urge the developers to consider making this option available since it would come in handy quite frequently as a quick shortcut to commonly used code.

Attachments:
Screen Shot 2019-01-03 at 10.13.44 AM.png (106.1 KB)

>>Kays
For my Houdini tutorials and more visit:
https://www.youtube.com/c/RightBrainedTutorials [www.youtube.com]
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
don't see why not.

Open file VEXpressions.txt in: (naturally, BACK IT UP FIRST !)

C:\Program Files\Side Effects Software\Houdini 17.0.416\houdini\

scroll down about midway, there they all are…


#
# Attribute Wrangle SOP
#
attribwrangle/snippet
Color from Bounding Box
@Cd = relbbox(0, @P);

attribwrangle/snippet
Random Point Color:
float seed = 0.12345; // seed for rand
@Cd = rand(seed + @ptnum);

attribwrangle/snippet
Color Based on Threshold
int condition = (@P.x > 0) ? 1 : 0; // short form if() test
@Cd = set(condition, 0, 0); // write condition into red color

attribwrangle/snippet
Point Group on Threshold
string group = “mygroup”; // group name to add points to
int condition = (@P.x > 0) ? 1: 0; // short form if() test
setpointgroup(geoself(), group, @ptnum, condition);
@Cd = set( condition, 0, 0); // color if in group

attribwrangle/snippet
Fetch Second Input Cd Attribute
// Second input used as reference geometry
// Use prim and @primnum to get a matching primitive attribute.
@Cd = point(1, “Cd”, @ptnum);

go nuts adding your own I guess…..but BACK IT UP FIRST
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
Actually, you don't have to edit that file in the install dir. Houdini will look for any VEXpressions.txt files found in $HOUDINI_PATH or your preferences folder, and add those to the drop-down.

You can look at the original to follow its conventions.

# Lines starting with # are comments and ignored
#
# Each entry starts with no indentation and gives the key used
# by the menu callback. By convention, this is nodename/parmname.
# Multiple keys can be given for the same entry.
#
# The next line gives the name of the expression. Its indentation
# level is then used for the remainder of the text. All the
# code until the next parameter are appended together to make
# the snippet. All preceeding indentation is removed.
# Note that tabs == 8 is assumed.

attribwrangle/snippet
This is my cool snippet
printf("Hello world");

Hope that helps!

Attachments:
screenshot-area-2019-01-03-225453.png (138.2 KB)

I'm o.d.d.
User Avatar
Member
833 posts
Joined: Jan. 2018
Offline
Perfect, exactly what I was hoping for….thank you!
>>Kays
For my Houdini tutorials and more visit:
https://www.youtube.com/c/RightBrainedTutorials [www.youtube.com]
User Avatar
Member
130 posts
Joined: June 2016
Offline
That was cool to know!.

I usually do another simple trick for this. I find it cool to get the snippets
in the tab menu so that i can tab and search my snippet easily.



https://www.instagram.com/p/BsGW8kWgKhN/?utm_source=ig_web_copy_link [www.instagram.com]


also I use node presets for the same as well.


Thanks!

Attachments:
tabmenu.PNG (17.1 KB)
node preset.PNG (55.4 KB)

Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
User Avatar
Member
146 posts
Joined: Sept. 2011
Offline
… and the super thing about saving stuff as node presets is that it also saves any spare parameters your preset node may need.

eg. find yourself constantly needing to add a bit of human wobble to your camera? Houdini gives you approximately 792 different ways to do this, but my favourite has been:

Create a null, put some expressions to create some noise on its rotations, and add some parameters to feed/control that noise. You don't want to have to tit about with the expressions every time you want to control the wobble when you can make a baby UI on the Null itself:



The expressions I've stuck on are like this:

turb($T/ch("freqx")+837,0,0,2)*ch("noise_scalex")*ch("noise_scale_global")

Change that 837 to a different number on each axis. Save it as a preset called “Camera wobble” or “Rotation noise” etc. That's the hard part over.

Now anytime you know you're gonna want a camera with a bit of humanising wobble, link your camera to a null, and animate that null with the main camera moves, instead of the camera object itself. Then you can stick another null in between:



and call up your wobble preset:



Now you have some nice friendly wobble controls, just by adding a null and picking a preset. Yummy.
Edited by howiem - Jan. 7, 2019 04:41:28

Attachments:
Screen Shot 2019-01-07 at 09.30.16.png (26.0 KB)
Screen Shot 2019-01-07 at 09.22.11.png (64.0 KB)
Screen Shot 2019-01-07 at 09.21.08.png (6.7 KB)

User Avatar
Member
255 posts
Joined: Sept. 2012
Offline
I wish Sidefx add a search tab option for preset… But i have already request this many times.
Okay, i have more than 50 or 70 wrangles presets , how could i export it from h18 to h18.5 please?
Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts
http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
User Avatar
Member
142 posts
Joined: Aug. 2009
Offline
Easy just copy attwrangle.idx to your doc in 18.5 preset .I have 200 wrangles pres It Works .
User Avatar
Member
255 posts
Joined: Sept. 2012
Offline
Did i post that? Scusy, though i didn't . Yes, i have to relaunch houdini, first time i think i restarted it too early so that's why i thought it didn't work out!

Thanks you Tesan, have you seen this from David?


https://www.youtube.com/watch?v=stNN79VRAao&list=PLVPTX7KtnqVrBWGyYoGoG_If6U-v4miZ0&index=6 [www.youtube.com]
Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts
http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
User Avatar
Member
142 posts
Joined: Aug. 2009
Offline
@vinyvince I use binary editor (\bin\hidx.exe) that already exit in Root of Houdini, You can break shuffle do WY you Want with Presets
Edited by Librarian - Nov. 16, 2020 16:23:27
User Avatar
Member
385 posts
Joined: July 2018
Offline
Librarian
@vinyvince I use binary editor (\bin\hidx.exe) that already exit in Root of Houdini, You can break shuffle do WY you Want with Presets
when i try to open it nothing happens. How do you use it to save vex snippets?
  • Quick Links