Subtitles section Play video
Welcome back to Houdini isn't scary, part 3, dynamics.
So in this part we're doing something completely new, we're going into dynamics.
Now dynamics are used to create simulations, and simulations are approximations of real life systems.
What that means is we can create things like water, and fire, and smoke, and snow, you know, destructive forces, and all of these different things that are organic and you cannot keyframe and animate, but are rather generated through dynamics.
And as you can guess from the word dynamic, it's the opposite of static, so it's things that evolve over time.
So let's not waste any more time, let's get straight into it.
From where we left off last, we have our donut with its icing and its sprinkles.
And if you didn't save this file, don't worry, there is a link down below to download the one that I've created for you.
Everything is named, I've also added some nodes, you can go read those, all of these have been renamed so you know exactly what they do.
But if you have your own file, you can also continue with that, and that's perfectly fine.
So what we're going to be doing now is creating dynamics.
So to start on our first dynamics network, we can go ahead and drop down a geometry node.
We can rename this one to a dynamic sprinkles, just by double-clicking on the name.
And then we can dive inside by double-clicking on the node.
So once we're inside, as expected, we can see our ghosted donut.
And if you can't, remember to just switch on ghost other objects in the top right.
In here, we're going to drop down a grid.
So press tab and type grid.
And we can drop down a grid in our dynamic sprinkles node.
And remember from part one, you can just move around by holding space.
So we're going to scale this down to a two by two grid so we can see it there.
And then we're going to drop a transform node because we want to move this up.
Let's just move it up to about four.
And that should be fine.
And what this grid is going to do is it's going to emit points.
We're going to have points that fall from this grid and they land on our donut.
We're then going to copy tubes to those points to make sprinkles.
So we're dynamically creating some sprinkles that are going to be thrown over the donut.
Now, the next thing that we want to do is we want to animate this grid.
Because as time passes, we wanted to move from the left-hand side of the donut to the right-hand side of the donut.
So to do that, what we're going to do is firstly move our grid over to the left.
We can set this to minus three.
Then what we're going to do is we are going to hold alt and click on this word that says translate.
What that'll do is it'll make all of these green.
And what that means is that we have a keyframe on the current frame.
So this current frame is keyframed.
Now, if we go and move along our timeline, we can go to the bottom and just click on this one where it looks like a flag and drag it across.
We can drag it all the way over to about 230.
So we're going to frame 230.
And then what we're going to do is move back up to our grid and move it over to three.
So you can just type three.
And now you'll notice that it's no longer green.
It's showing yellow, blue, and blue.
Yellow means that something has changed but has not been keyframed.
Blue means it has remained the same.
So there's no problem there.
So what we need to do is hold alt again and then click on translate.
And it'll add new keyframes.
So now if we go back to the beginning, you'll notice that as we play this back, our grid will move from the left to the right.
You can see it gradually move over.
And that's perfect.
And if yours is playing back too fast, then you'll just need to check the real-time toggle.
So click on real-time toggle to activate it.
Because if it's deactivated, Houdini will just play this back as quickly as it can.
When this is activated, it'll play it back at 24 frames per second.
Great, so we have our grid that moves.
But now we need to turn this into an emitter.
We need to emit points from it.
So what we need to do is we need to create particles.
And you create particles inside of a dynamics network.
Now particles are also referred to as POPs.
And POPs just stands for particle operators.
And you may have heard of other terms like this.
You may have heard of DOPs.
That's just dynamic operators.
Or SOPs.
Those are surface operators.
And don't get too confused with those.
Basically, SOPs is everything that we've been doing.
DOPs is what we're going to be doing in this tutorial.
It's dynamic operators.
So POPs fall under dynamic operators because particles are dynamic.
So to create our first dynamic network, we're going to press tab and just type POP.
And you'll see over there it says POP network.
Click on that and place it down.
Now it has many inputs.
But we're just going to use the first.
We're going to take our transform and plug it into our POP network.
Set your display flag on the POP network.
So we have our POP network.
And as you can see there, it says DOP network.
That just means dynamic operator network.
That brings us to anatomy of a solver.
So let's dive inside of this and see what's going on.
Inside of here, we have four main nodes.
So here's an illustration that basically breaks it down for you.
At its core, a dynamics network needs a solver.
What the solver does is it takes all of the information.
It takes your parameters, your settings, all of your inputs, and mixes them all together in a part and outputs something for you.
So this is basically the brains of the dynamics network.
Next, on the left, we have something that is absolutely always necessary.
We have the object.
So the object goes into the leftmost input of the solver.
And if you remember from our previous tutorial, we said that generally what goes into the left input of a node is also what is output by that node.
And that's the case with dynamics as well.
We have our object that goes in.
And then it gets adjusted by our POP solver.
And then it gets output.
Now on the right hand side, we have sources.
So what happens here is we source things into our dynamics network.
For example, if we need fuel for a fire, we need to source that in.
If we need fluid for a flipsim, we source that in as well.
And what that does is it feeds it into our solver, adds it to our object, and then finally it gets output.
And that's the last node, the output node.
So you have your solver, your object on the left, your source on the right, and those output something.
And then in between your source and your solver, you can add things that affect the source.
So you can add a wind or whatever it may be that you want to affect the source.
Then after your solver, you add things that affect the entirety of the sum.
So you could add gravity, or you could add a collider.
So you know, a ground plane.
Whatever it is, you would add that after the solver.
And really, that's all there is to dynamics.
It doesn't get much more complicated than this.
And you may have seen very advanced setups before, but I can assure you it follows the same setup everywhere in Houdini.
Just these four nodes.
And sometimes it's even three.
You don't even need a source sometimes.
Sometimes the object can be the original source, and you never add anything more to it.
And this is something that I didn't really realize when I first started in Houdini.
That dynamics networks are quite basic, and they all share something in common.
So I'm going to show you a file that has the different types of dynamics networks.
So here we have a vellum network.
As you can see, a source goes into a solver, an object goes into the solver, and that gets output.
In between there, you have gravity.
But it's still made up of those four nodes.
If we go back, we can dive into a pyro network.
You see, we have this pyro object on the left, the source on the right, into the solver, and output.
And then we have extra things being fed in.
But if you get rid of this, there's no errors.
You can clearly see, if you just delete that, absolutely no errors.
It's perfectly fine with that.
Next, we can go over to flip.
Once again, same thing.
Source, object, solver, output.
Now, there's these two at the bottom, and these are slightly different.
In an RBD setup, we have the object, the solver, the output.
And then over here, an object into a solver to an output.
It's all the same.
And you just need to understand that setup to really get to grips with dynamics.
And these are just generated by shelf tools.
There's nothing special about them.
These are the basic ways to set up each of these dynamic networks.
So back in our file, let's start on actually creating our sprinkles.
So we have this on the right.
We're going to go to our source.
So click on your pop source.
It's this source first input.
And as you can see, we have multiple tabs on here.
We're going to go over to birth because we want to birth some points.
So we're going to go down to constant birth rate and set this just to 100.
When we play this back, you'll notice two main things.
Firstly, we have these points being left behind.
And these are our particles.
This is what we're generating with our dynamics network, with our pop network.
The other thing that you may notice is this blue bar at the bottom.
What this represents is all of the frames that have been simulated.
So that means that they don't need to simulate again.
We can just play it back and it's all been saved to memory.
And it's all been cached, right?
So no problem there.
But going back to our particles, they're not doing anything yet.
And the reason is we don't have any forces inside of our network.
So let's add our first force.
With pops, they have their own forces that you can add.
So we're going to add a pop wind.
So just press tab and type pop wind.
If you remember what I said earlier, we can affect just the source if we plug things in between the source and the solver.
And so pop wind sits right in there.
And we also know that it fits in here because of these purple inputs and outputs.
So now we can go up to our pop wind in our parameters and give it an amplitude of one.
So amplitude is another way of saying how much.
So how much noise do we want?
So we're just setting it to one.
And then you'll notice that on our timeline, that blue bar has become orange.
And that's because Houdini has recognized that something has changed inside of our dynamics network that has not been re-simulated.
So that means we need to go back to the beginning and simulate it again.
So you can just click on this on the far left.
That is your first frame and it'll jump back and then press play again.
And now we're starting to get some movement.
Our particles are kind of just flying away, but that's not what we want.
We want them to fall down.
So like I said earlier, if you want something that affects the entire object, you can add it between the solver and the output.
So we're going to drop down a gravity force between our solver and our output.
So press tab and type gravity.
Put that in between your pop solver and your output.
As you can see, it has a force over there.
And if we jump back and play again, we now have particles that are falling down.
Great.
So now what else would we like to add to this?
Well, we would like to add our icing so that it can actually interact with it.
So to do that, we can press tab and bring in a static object.
A static object is just a collider of our choice.
And so we can place it to the left.
And you'll notice it doesn't have an input, and so we can't fit it between our solver and our output.
What we need to do, we need to bring in a merge node.
So we bring in our merge node, and then all we do is connect our static object to it, then our solver, and then that can go into gravity.
So we're still following that same formula of just the four nodes.
We have a source, an object, and output.
But now we're adding things to it.
We've added a wind, we've added gravity, and we're adding a static object now.
So to add an object, we click on it and go to SOP path.
And what we would like to bring in is our icing.
So we go to icing and select icing out.
And all of a sudden, it's in our network.
And so if we play this back, you'll notice that our particles fall, and they should interact with this, but they don't.
And the reason is, although we can see our geometry, it has a collider that Houdini generates.
And that collider is based on the geometry.
But if that collider isn't accurate enough, our particles will just ignore the geometry.
So to see our collider, we can uncheck display geometry, go over to the collisions tab on our static object, activate collision guide, and you'll see that there's nothing there.
So what we're going to do is we're going to increase the uniform divisions.
So that's basically how accurate our collider must be.
We can set that to 150 and then go down to offset surface and just offset the surface by 0.01.
And there you can now see our donut collider.
And we can just hide our collision guide and then display our geometry again and play this back.
So now if we take a look, our particles hit our donut and bounce off.
So pretty cool, right?
But they're not exactly sticking yet.
To make them stick, we would need to add a collision behavior.
So where do you think you would add that?
Well, if it's for this particular source, it goes between the source and the solver.
So we move this up over here.
And what we want to add over here is a collision behavior.
So press tab and type collision behavior.
Pop collision behavior.
You can plug it in after your popwind.
And on here, it says behavior and it has response.
So what would you like the response to our particles colliding with something be?
We can set that to stick.
So now our particles should stick.
But there's one other setting that we need to change and that's on our solver.
So go onto your solver.
We can just go over to collision behavior.
And there's this little add hit attributes box.
So we need to enable that so that it actually checks for collisions.
And now we play this back.
And as they collide, they stick to the surface.
And it looks quite good.
And they also get colored red because our pop collision behavior has a color hits option.
Now, I know you may be thinking that there were a lot of changes that we made here.
But the setup isn't exactly the most simple setup.
It's actually reasonably advanced.
What you're doing is you're making particles fall onto a donut and actually stick to it.
And so this is your first step to dynamics in Houdini.
And that's a big step because dynamics are really what make Houdini so amazing.
So let's go up a level where we can click on this dynamic sprinkles.
If we click on our pop network and then go up to the top and say hide other objects, you'll notice that it's outputting both our particles and our icing.
We only want our particles.
So what we have to do is go to our pop network.
In its parameters, it has an object merge on it.
And over here, it says number of objects, objects, asterisk.
In Houdini, asterisk means everything, right?
It means all.
So all objects just merge it, right?
And output it.
But we don't want every object.
We only want our particles.
So if we go in here, we look for our pop object.
And all we have to do is give it that name.
It's called pop object.
So we can change this asterisk to pop object.
All of a sudden, the icing disappears and all we have left are our particles.
So great.
Now what we can do is drop down a null as we've done before.
And output this as dynamic sprinkles underscore out.
Dynamic sprinkles out.
We can go back up to the object level and hide our dynamic sprinkles.
So here's another really cool thing about Houdini.
It's procedural.
So we can go into our sprinkles node.
And what we can do is instead of bringing our icing in and scattering points for our sprinkles, we can just bring in the sprinkles that we created in our dynamics network.
And so how do we bring it in to this network?
Just like we've done before.
We can press tab and object merge.
So now that we have this object merge, we need to go select our object.
So object one, go ahead and find your dynamic sprinkles.
So it's over there.
Dynamic sprinkles out.
And if you set your display flag, you'll see that it's been brought in.
But now we want to put it in over here.
So what we can do is drop down a switch node.
So now we want to be switching between our scatter points and our new dynamic sprinkles.
So plug your scatter points in first and your sprinkles.
And if you set your display flag on the switch node, you can switch between these two.
Now it's very simple to just plug our switch into our old setup.
And if we take a look at the last node in the chain, it now uses our sprinkles.
If we play this back, our sprinkles fall and some of them will stick to the surface.
Now, I know that looks very weird right now.
They're all facing up.
And that's just because we no longer have normals.
As you may remember, we generated normals before on our geometry and then scattered the points with that.
So all we need to do is transfer those normals from our geometry onto our new sprinkles.
So we can press tab and type transfer.
And you'll see an attribute transfer node.
So we can just slide this in between our object merge and our switch.
And it needs a second input.
It just needs this generate normals node.
Plug it in there.
And what this will do is it'll transfer our normals from our geometry onto our points.
So if we take a look at this by displaying point normals, you'll see that all of these points now have the normals being transferred to them.
We can go back down to the bottom, go to the beginning, jump up a level and view all of this together.
So just play it back.
As you can see, our sprinkles are falling onto our donut and sticking.
And once again, the power of Houdini allows you to add new things to this.
So once again, you could switch out your tubes for spheres.
So we can drop a sphere, change it to a polygon mesh, uniform scale of 0.25, plug it in here.
And it's the same thing.
And so what we've done is we've successfully created our first Dynamics network and used it in one of our existing setups.
Now I know a lot was covered here, but I just wanted to introduce you to Dynamics.
I hope Dynamics weren't too much.
It's an entirely new concept and it may be too soon to be introducing this in part three, but the sooner that you get comfortable with Dynamics, the better, because you can do so much in Houdini with Dynamics and it really is a major aspect.
So thank you for watching.
Hope to see you next time.
Please consider leaving a comment below, leaving a like and potentially subscribing.
And I'll see you next time with part four of Houdini isn't scary.
Bye.