Procedural seaweed

Just a quick scene for my first post. It highlights my over reliance on programming and provides a demonstration on how to not approach Houdini, but it works, so whatever.

seaweed.gif

The result is subtle, simulates fast, and may or may not be useful when it comes to adding a mesh, but that’s beside the point.

You start simple, grab a grid, scatter some points and group them. This will be the starting points to grow from.

Look at that nice clean network

Look at that nice clean network

Then grow the seaweed… Ok time to code. Chuck down a point wrangle.
Start by declaring some variables to control, such as overall height, scale between points, chance to spawn a branch, and branch lengths. You can add branch angle control if you want, but as you can see I got lazy.

Get a random height, and fit it to the range you want. then start your for loop. This will first check a random number against your branching chance, then if successful will randomly pick left or right. Using the same method, create a random number based on branch length, then start your second for loop. This will simply place a new point depending on the point distance scale and angle. Once this loop finishes, it will then add a new point to the main stem directly above. Make sure you maintain references to the previous points so that you can connect it to the new point with a polyline.

Hooray! You now have a OK but mostly terrible looking grid of seaweed. Time to improve on that.

Now start configuring the vellum system. Add cloth and leave everything default except for bend stiffness. Turn that waaaay up, like 1e+10 ups. Plug this into a pin constraint and set the group to the base configured earlier. Set a string constraint and do the same with bend stiffness.

Plug that into the vellum solver, and change the gravity from -9.8 to 0.01 in the y direction. This adds a slight buoyancy force to keep it up. Jump inside the solver and connect a popwind node to the force output. You can play around with this as you like, but leaving the noise parameters default and setting the noise amplitude to 0.1 gave pretty good results.

And there you have it, a procedural, customisable, seaweed generator. Put a simple polywire on it for an easy mesh and you’re good to go.

HIP file

Quicktip: VSCode has a VEX extention to allow for highlighting and auto completion. Much better than the inbuilt editor. However, triggering it to open in conjunction with Houdi is wack man, so I just copy and paste.

Quicktip: VSCode has a VEX extention to allow for highlighting and auto completion. Much better than the inbuilt editor. However, triggering it to open in conjunction with Houdi is wack man, so I just copy and paste.