DEV Community

Kwesikwaa Hayford
Kwesikwaa Hayford

Posted on • Edited on

Houdini: Varying carve node values for multiple splines

While Houdini allows splines/lines to grow through the carve node, it gets tricky when a bunch of splines need to be grown over time at varying speed.

playblast

This code might help you if you are in such a position.

fit01(rand(detail("../meta","iteration",0))*ch("slider")*2,ch("slider"),1)

Let's get right into it!

  • Drop a grid, size x= 2, y =10

  • Adjust rows or columns based on your preference, in this case i want to extract the columns so I pushed it to 50.
    Mind you, I am only using a grid for the demo, what you decide to use is up to you.

  • Drop a polypatch node for the extraction. choose columns in the connectivity property and tick "Output polygons".

patch node

  • Drop a "foreach primitive" node. In the "foreach_begin" node click on "Create Meta Import Node". Rename the meta node of the foreach begin set of nodes to something shorter(optional but since it will be needed in the code, making it shorter is better. I made it "meta" in this case)

network

  • Now drop the carve node and pipe it between the "foreach_begin" node and the "foreach_end"

  • This is where the magic begins. in the carve properties, click on the parameter edit menu icon and choose edit parameter interface

settings

  • Drag a float parameter and add it to the existing parameters list, in my case it, I placed it under the "Second V" parameter. Now rename the "name" and "label" properties; i named both "slider", ticked the range option and changed its values from 0-10 to 0 -1. click apply and accept.

parameter edit panel

  • Back in the carve parameter panel, depending on what you want to slide over, be it "First U" or "Second U", paste the code into it.

done

fit01(rand(detail("../meta","iteration",0))*ch("slider")*2,ch("slider"),1)

  • Now slide your "slider" float parameter you added and there you have it. Animate the slider.

The code in detail

  • Important part: detail("../meta","iteration",0) : as you can see the "meta" node is referenced here. What the detail does is, it gets the value of each polygon or iteration: the default being 0

  • The ch("slider") is the custom slider which multiplies with the detail value.
    detail("../meta","iteration",0))*ch("slider")
    Note that these alone will work, but will create an undesirable ramp across the splines and that is where the rand function comes in
    rand(detail("../meta","iteration",0)) * ch("slider"). this uses the detail iteration value as a seed to create random values between 0 to 1. This will make the effect work nicely with the desired randomisation.
    The only issue this presents is, some will get to the destination point and others wont. To counter this the fit01 function is used. It takes the randomised value, and uses the slider as min and 1 as max.
    fit01(rand(detail("../meta","iteration",0))*ch("slider"),ch("slider"),1)
    This works perfectly, speed is varied and they all get to the end point when the slider gets to 1.

This should be enough but in order to have some sort of speed control I added a multiplier of 2 to the slider value
fit01(rand(detail("../meta","iteration",0))*ch("slider")*2,ch("slider"),1) Totally optional.

So there you have it. have fun.

Runner H image

Overwhelmed? Let an AI Handle Your Tasks

Runner H clears your inbox, summarizes Slack threads, and plans your week — without you lifting a finger. You delegate once. It handles the rest.

Try Runner H

Top comments (0)

Heroku

Build AI apps faster with Heroku.

Heroku makes it easy to build with AI, without the complexity of managing your own AI services. Access leading AI models and build faster with Managed Inference and Agents, and extend your AI with MCP.

Get Started

👋 Kindness is contagious

Discover fresh viewpoints in this insightful post, supported by our vibrant DEV Community. Every developer’s experience matters—add your thoughts and help us grow together.

A simple “thank you” can uplift the author and spark new discussions—leave yours below!

On DEV, knowledge-sharing connects us and drives innovation. Found this useful? A quick note of appreciation makes a real impact.

Okay