Houdini Tutorial: Simulating Curling Ribbons in Vellum

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] foreign tagma the idea for this setup came from a question on a patreon community Hub where I've been mainly publishing the course on kinfx over the last year but since this effect can be quite easily achieved just using Vellum we're publishing it here on YouTube so the question was how it go about recreating an effect like in this beautifully executed project by playback design and again this is quite easily done using Vellum and blending some rest length so let's jump into Houdini and get going with these sorts of setups it's usually a good idea to work on a single ribbon first and then apply this to lots and lots of copies so let's just do that first of all let's of course dropped any Geo node type inside and first of all I want to drop down a grid this will be my ribbon on my grid I want to set the size to a value of 0.2 by one I want to move it over a bit in the easy Direction by a value of 0.5 5 so that one end is right here at world origin and I want to change up the rows and columns or the rows to a value of 47 so I get roughly Square divisions on my ribbon here also later for rendering let's just drop down some UVS by using a UV texture node where it is in and to get the proper orientation let's set the Y scale to the value of -1 now from this simple to use room here I want to Branch out and I'm going to create two versions of my ribbon one that is bent just slightly and one that is curled into the curls that we're looking for so let's do just that let's drop down a band stop let's switch to a handles to sorry that we can see what we're doing and let's first of all tweak the capture parameters a bit so the capture origin I want to move forward a tiny bit so let's add another value of 0.1 so that this part right here at the end remains stationary and then I want to add a tiny bit of offset to the capture Direction a value of minus 0.02 so that if I increase the band angle and I increase it a whole lot I get this curl right here but this is the version of a ribbon that this girl just a tiny bit so let's set the value let's say to a value of 13.7 that worked nice for me something like this let's create a second version let's just duplicate a band node right here let's set the band in this case to a value of 1080 degrees something like this and I think this is curled a bit too much so let's reduce it bit by increasing the capture length to a value of maybe 1.91 something like this looked fine for me now let's turn both of these streams into Vellum objects so let's drop down a Vellum clock and on my Vellum cloth let's adjust the parameters first of all I want to set up some pinpoints and in this case I think I just want to grab the first two rows something like this and scrolling down to the band I want to increase the band stiffness or the multiplayer for the band stiffness a whole lot the value of 0.1 and this will give our band constraints enough strength to curl into this spiral I want the exact same Vellum settings for my other audio stream right here so let's create a reference copy and I can create a reference copy by holding Ctrl shift at alt and then just dragging my Vellum cloth node and now I get a copy of my node where every parameter is a relative reference to this node right here so they both linked and now we have two Vellum objects and the main difference between those two Vellum objects and let's maybe switch back to our camera view is of course the shape but also the rest links on those two objects and if you know relum you know that those rest legs on those constraints are the main driving Factor behind the shape of a Vellum object or of a Vellum simulation in the end so my idea here is since these two objects have the exact same topology the exact same number of constraints and points and so on I can just take the rest length of this curl state right here and copy them onto my main ribbon right here and then later in the Vellum server just blend between the original rest length and the curled rest lengths right here and therefore make my ribbon curl into a spiral so let's do this let's first of all copy over the rest length of this geostorm right here to this one right here so for this let's just use an enter copy drop this down let's wire in the constraint geometry of our main volume object right here and deconstration geometry of a gold volume object right here and let's first of all set both groups to primitive since we're working on Primitives and we want to copy over not a CD attribute but a rest length and we want to rename it and let's call it rest length underscore goal so let's take a quick look at the geospreadsheet and let's see what happened here so on this Geo stream owner constraint from between we now have three rest links we have the main rest length which is fed to a volume simulation then we have the rest length girl that we brought over so this is our card State and then we have the rest length original which is right now the same as a main rest length right here and is the rest length that we're starting out so a straight or uncurled state of a Vellum ribbon so my main idea here is inside of alarm solver set up a little Wrangle and then just set the rest length to a blend between a rest length original and a rest length goal and if a blend is closer to a rest length goal it would be curled and if it's closer to a rest length original it will be straight so let's try this let's maybe make some room here let's wire this into a volume solver our main jio goes in here and our constrained yogurts in here first of all let's set up a ground position and let's move it a tiny bit down a value of minus 0.01 and then let's jump inside and let's drop down a geometry Wrangle let's first of all set this up we want to run over Primitives because all our constraints are Primitives in the data bindings we want to run over not our main geometry but our constraint geometry and now inside a cold field let's write our code and for now just for testing this will be a simple one-liner so in the end we want to modify our rest length so let's grab F at rest length and this should be equal to a blend or in Vex terms a linear interpolation or lerb for short so durb between R rest length orange original rest length and our rest length underscore go curled rest length and as a blending factor in let's make some room in here I want for now a simple slider let's create a float slider and let's call it blend let's close all our parentheses let's add a semicolon and let's hit this button right here to create a blend slider so now with this setup done here let's add a simple animation let's maybe wait until frame 10 until we start animating then let's add a keyframe to a blend slider and then let's maybe move to frame 50 and set the slider to 1 and add another keyframe let's test this let's jump back out and let's Sim this and we see a ribbon sort of deforming and sort of struggling to curl into a spiral but it's not happening right now and the reason is not happening is for these very strong band constraints we also have to increase our constrained iterations a whole lot to make them strong enough so in this case let's just increase them tenfold and also to give a ribbon a bit more help I also decreased the gravity in this case to a value of -4 let's try that again and now ribbon is curling up nicely so this is the main part of our setup done let's just now work on creating multiple copies of a ribbon and controlling them not with a simple slider but with an attribute so we can get more variation let's disconnect our Vellum software for now and let's work on creating copies of our main Vellum object then for this first of all I want to pack it let's create a Vellum pack where in both our main geometry and our constraints and now we have them just in a single Geo stream and I can wire this for example in a copy two points which I'm going to copy a little later and then I can use a Vellum unpack to get my streams back and fire those into my Vellum server but let's for now work on our copies for my copy object I want to be a bit lazy and I just want to use a spiral to get something that sort of looks like filo taxes and on my spiral I want to set up six turns I want to have an increase by turn by adjust the value of 0.1 and I want to have a fairly High number of Divisions per turn let's set it to 250 and we get this spiral right here right now we have the problem that uh points in here are very tightly packed and up here right at the end they're a lot looser so let's just make them even with a resample node and for the size of a ribbon's value of 0.1168 worked nicely and also while we're at it I want to create a curve U attribute that I'm going to use later to drive the curling and uncurling animation next for a capital points to work let's also create some normals on these points and this will be a very simple Wrangle again and I just want to have the normals Point outward from the center of a spiral and this is quite easily done by first of all modifying on normals Anonymous should just be unnormalized we add P Vector deposition and space and if I turn on normal display now they're just pointing out let's wire this into a copy the points let's see how this looks and maybe just take a look at the Vellum unpack and maybe turn off point a normal display and yes this is looking fine so now on this geostream right here I want to create a point attribute that will later drive our animation essentially turn our slider from the first example that we built up here and I basically want to start inwards from a spiral curling all those ribbons in and then later starting from the end of her spiral flattening all our ribbons out again and I want to do this in a simple Point drop let's jump inside and what I mainly want to do here is to drive a gradient from the inside of our spiral outside and then from the outside back in again and for this first of all I want to use my curvy attribute that I created earlier so let's bind it in input R curve U and I also want two parameters so let's drop down two Palm nodes and the first one should be the position of my gradient on this curve let's call it pause and the second one should be the width of the gradient and let's call it width and for the width I want a default value of 0.1 and if we jump back out now we should see these parameters also here on our wob and the sort of classic way to do this is to just drop down a fit range and wire in Arc View and then in the Min position it's wearing a pause and for the max position let's wire in two opposition and a width added together like this and just to view this let's just write this into the color output and now if I jump back out and I move the pause slider I can drive the color and also therefore later or animation on our curve let's change a few things up first of all I want to invert my color because black should mean the straight state of animation and why it should mean the curl state so on my fed range let's just invert the Min and Max like this and let's also write it not just a color but also an attribute that I later want to use let's use a bindex part and call our ad trip NM like this and let's wire an output here as well there's one thing that's annoying me a bit and that is even there out here my position value is at zero some points are already white so already in there State and that just increases but if this value is at zero I want every point in here to be black and not those first three points to be white so let's quickly fix this as well and this is quite easily done by making a bit more room here before first fit and by dropping down another fit range and in here let's wire in as an input first of all or position then this goes into our second fit into the minimum position like this and also in the add node so we're basically replacing all connections from a pass node with this fifth note and then let's also drop down and multiply constant and let's take the width in there let's multiply it by -1 and then where this in the destination Min of this fifth note let's reorder this up a bit here to make this a bit clearer this is our wob in the end and if I jump back out if I start at zero every point is black and if I move to one every point is white so this is exactly what I want let's wire this into a copy to points and on a Vellum unpack I want to also transfer this anim attribute to my geometry like this so now this slider is essentially my control for my animation right here and let's set up a simple animation for this for this final setup I want to set my frame rate to a value of 25 because this is what used and let's start out at a first frame of 25 let's add a keyframe at zero right here then let's move to frame 150. let's set a value here to one let's make a timeline a lot longer let's say 350 frames let's move to frame 175 add another keyframe right here again at one and then move to frame 250 right here and again set a value to zero like this so we got a Vellum Geo set up we got our animation attribute setup let's finally work on bringing this attribute into a Vellum solver and driving the animation with this so first of all let's wire in our volume solver in this case on my Vellum solver I also want to increase the Collision passes since we have a lot of collisions in here and let's say we want a value of 40 and also for my PC since I got at 64 gigabytes of RAM I increase the cache memory to a value of 50 gigs but this is of course dependent on your PC specs now let's make sure we can grab the NM attribute inside the solver because the solver will just grab the first frame and stick with this so let's create another Branch here let's create a null called this anim and wire in our constraint geometry in here and if we take a look at the Geo spreadsheet we should see that our NM attribute is on point level and we want it on primitive level of course so let's promote it from point to primitive like this now let's jump into a solver let's take a look at our Wrangle again and in this case first of all we need to set up another input and in this case on input 2 I want to grab a sop and this sop will be a reference that we called anim and inside account we want to replace this value right here with our animation value so NM and we have to grab this value and in this case uh float NM will be a primitive attribute or on Geo stream one called anim and we're looking at our current premium that we're processing here like this so let's jump out and test this and of course our simulation now runs a good bit slower but let's just wait for it and see if something happens and at this point right here right around frame 52 we should expect to see some curling starting but we don't and this is for a reason it's somewhat hard to find which is the reason that our Vellum simulation and I think in moving a simulation Geo to our GPU and back well miss changing the Primitive order on our Primitives so the references that we set up here don't work in here or they're Landing in the wrong places there is a simple fix for this in a Wrangle right here we don't just want to rely on a simple primitive number right here we want to rely on an ID attribute and let's create this let's drop down and enumerate sub to create ID attribute and let's wire this in on both our constrained geostreams and the type should be primitive again and the attribute should be called ID like this and it should be an integer and now in our geometry re angle inside our solver we want to grab the trim that we're looking for and we want to grab it by the ID to Prem function and this should look on gs31 and our ID attribute is I add ID like this and then in here let's not use a premium let's just use the prim variable that we created up here like this and now this should work let's jump back out let's play animation and let's see if something happens and yes indeed now a ribbons start curling in and since this is a fairly slow Vellum simulation right here I can just drop down a file cache where it is into my volume solver let's set the file path to explicit we can leave the file name right here as is and then just hit save the disk and maybe drink a coffee or something so this is it for today this is how to build this Vellum curling ribbon setup one thing that you might want to explore in the setup is changing out this NM attribute right here and this could for example be just as well a mobs offset if you're a fan of the mobs tool set this is just the simple example that I used for this setup right here but of course you can use whatever you want in here so this is it for today I hope you liked this I hope you have fun experimenting with this and until next time it's cheers and goodbye
Info
Channel: Entagma
Views: 14,980
Rating: undefined out of 5
Keywords:
Id: KN4VPy6HT8g
Channel Id: undefined
Length: 20min 2sec (1202 seconds)
Published: Mon Apr 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.