In this lesson, we're going to start to break up and shatter the ground to use in a simulation.
So before you do that, I just wanted to follow it from the previous lesson where we brought in the
Olympic cache.
And so now we have kind of a duplicate.
We have the Olympic and we still have the rig in our scene.
So let's get rid of the rig.
But the catch to that is because we've used the referenced rig, right.
We have reference there.
Again, we can go to file reference, Ed, and we can see that indeed, that's a reference rig.
We can also tell by these little blue dots that's a reference to rig or a reference.
You can reference models, you reference anything.
But this is a reference rig.
And if we were just to remove that now, it's going to take all of the shaders with it.
So our Olympic cache will no longer have all the shares that we have applied to it.
So the first thing we need to do is to import this so we can say file import objects from reference
so it's no longer referenced.
And we can see those little blue icons are gone and now we can delete this.
And so when we delete it, it's not going to take the shaders with it.
All the shaders down here are going to stay.
So let's take a look at breaking up the ground when we've learned how to do this in the bullet physics.
Kind of a couple of lessons at the beginning, but we're going to learn a new way.
So I'm going to unreferenced this so I can actually select the ground.
So we're going to learn differently.
And this lesson is how to use particles to shatter this object.
Now, we talked about this quickly and the previous lesson where let's take a, you know, a cube or
something, for example.
And if we drop it onto rotate this and let's just, you know, for argument's sake or for learning sake,
let's say we drop this on its corner right here, smash right now, if we use the Chater tool and we
can just pop that open, going to the effects and going to shatter like we've done previously, we're
in this middle tap or solid shatter five pieces.
Let's have no jaggedness, blah, blah.
That's all fine.
We don't need to delete the history, if you remember, need to go to edit delete by type history before
we use this.
So now when we apply, it should break this up into five different pieces.
We still have the original Kamps.
This was tie that.
But so the point of this is just saying.
You would expect if this tube fell from a certain height and it hit the ground like this right in this
orientation, that this corner, at first you would expect it to shatter more at the point of impact
and less as you go up.
But with this tool, there's no control over that.
Right.
It just shatters it in like evenly sized pieces.
I mean, it's kind of nice because they are, you know, at least pieces.
But like, it doesn't respect the fact that we want a higher concentration of pieces down here in the
U.S. at the top.
So there is a special kind of work around that we can do.
We can delete these and it doesn't involve this.
Well, you know, let me take that back when you could do let's say that's the case.
You could take this and keep applying this to it so we can chunk it down even more.
But this tool is very finicky, to be honest.
It's of terrible.
So if I had a you can see that, you know, we get our air.
And so, you know, it could be Free's transformation's.
It could be a history thing like this.
You know, you have to delete the history every time.
But, yeah, you get you get errors.
And it's just a super annoying.
But in theory, you should be able to keep chunking this down and like, break this up and then break
up, you know, another piece into a smaller five more pieces and that kind of a thing in theory.
But it's just this tool is kind of terrible.
And there's another there's there's another way and it's not super.
It's not a built in way necessarily, but it's kind of a hack.
But we also get it to introduce to another effects kind of system, and that is in particles.
And you can see up here everything has been in in here and constraint in cash and they all share similar
components.
So like each one of these is going to have a nucleus and a nucleus holds, you know, important information
for like what's gravity like, you know, what framed as a simulation start and stuff like that.
So it has this in because they used to call this in dynamics and the tab instead of it saying FXE used
to say in dynamics.
So it's kind of a holdover and like the old name.
But so basically what we're going to do is, is use particles to concentrate and use particles to say,
you know, wherever these particles are, that should be a piece.
And if we emit particles from the point that we want it to shatter from, there will be a higher concentration
of shards and fractures at that kind of point where the particle emitter is.
So let's just jump right into that.
So that makes more sense.
We'll go to and particles create a matter.
And in the outliner, you can see we have that nucleus that I referred to.
We have the actual emitter that's going to do the emitting and then we have the particles themselves.
So for the nucleus, the one thing we need to look at is the star frame, because we are let's go back
to frame 101 because we don't need pre role for this is just kind of using this as like a tool, almost
like a modeling tool.
But you can use it for all different kinds of things.
But so let's turn to the time attributes around the nucleus.
Let's go to time attributes and get the start frame to frame 1001.
So this will actually play back.
And if we select on the particles, we just hit play, let's have four.
Actually, let's at least move the emitter where it's going to be useful.
So the whole point of this is to do it where the guys punching through.
So let's go to the framers hands punch through.
We have the emitter selected so we can actually move the emitter, which is going to be this little
dot and this and it stands for the nucleus and it can be anywhere in the scene.
That position of itself doesn't actually really matter.
So basically, I just want to position this thing kind of in the kind of thickness of this piece of
ground right where the hand is punching through.
So we're going to have a higher concentration of shards right there.
Right.
It kind of makes sense.
So we have that place correctly and lets it play and see what we can see with these particles, but
first we want to go back to the start frame, which is frame 1001.
So I'll go back to frame 1001 and I'll hit play.
And now we can see all these particles emitting and the thing want to be careful about this effect that
we're going to be doing is the fact that each one of these particles is going to represent a new shard
and this volume, a new fractured piece and the more particles you have.
It gets very intensive, I just I just tested this and it took like maybe an hour and a half to do when
I had like 300 particles in the sand, it took like an hour and a half to cut up this piece of geometry
with these particles.
So we want to reduce the amount of particles we're actually emitting.
So let's go to the emitter and we can go to the rate.
And we just want to take this way down maybe to like 10.
And by default, your speed is probably at one.
And I cranked mine up to ten.
That's the other thing you might want to change because of the scale we're working at, one is going
to be way too slow.
So you want to make sure your speed is cranked up.
And the other thing is by default, we we do have gravity working on it.
So I'm going to try and escape and turn off gravity because we're just trying to get particles emitted
in here.
We're not trying to, like, be physically accurate at all.
So the gravity waves in the nucleus, so we can just turn down gravity or we can just turn the direction
to zero.
So these particles just kind of emit into like a bit, you know, just kind of like they're in space,
basically.
And let's let this run for a second and had escape and let's hear for so we can kind of see and I'm
going to select the particle here from that letter.
So it kind of highlights that I can kind of see the concentration here.
So it's a decent amount and I think it's going to get us like a good starting point.
So now we need a way to tell Miah to take these particles and use them as the center of new pieces for
this piece of geometry here.
So before we do that, we need to go through all the cleaning up of this piece so we can see that there's
some history here and it's not frozen, transformed.
So let's go modify, freeze transforms, let's go edit, delete by type history.
All right.
So now it's all clean.
So for this tool to work, it's actually a script.
I'm going to make it available for you in either a war document attached as a resource to download with
all of these files.
Most likely that's what it's going to be.
It's going to be on the floor with all the other downloads.
It'll be a text document.
And its credit goes to Malik Williams, who created this almost 10 years ago.
You can see I found this in a very obscure like page 15 on a forum.
But Voronoi is a type of shattering effect that he basically made this script.
So and any time you're doing Mel scripts, so that's my expression language you can see down here in
the bottom left, it says anyo.
So I got to start typing in all this code in here and run it from this little area.
So any time you're using Mel and it has these two dashes, that means this isn't going to run.
This is just for your information.
So if you're curious about how the script works, you can actually just look for these little things
and it's going to explain what each section is about.
And this is just because he's a friendly guy and took the time to actually write this stuff out to explain
what he's doing, he could have easily left this stuff out.
So you can look at each little section.
He's kind of explaining what each little piece does.
And this is how a lot of people learn how to do scripts and learn Mya's get scripts like this and they
kind of break it down and figure out, all right, what what is each little piece doing?
So for us, all we need to know is, are we just going to copy paste this?
You don't really need to know how it works.
So we do he does have instructions here.
He says select the particles and then the geometry.
All right.
And at zero for crack.
All right.
So we'll see, like the particles first.
It's like the geometry.
And then we can just paste that script here and hit enter and we're going to get this little dialog
box and we want to set the crack to zero.
So the distance between the cracks is zero.
So now when we look at this thing, we can see that indeed we have this kind of fracture that is going
to work with where we actually have an impact on this piece.
So we can do this multiple times.
And that's what I'm going to do, because, you know, if we were to do this for this whole piece and
with one particle system in one go, like I said, it would take a very long time.
But what I what we can do now is just keep repeating what we just did on each different shard so I can
go back and move the emitter to a new location, you know, somewhere maybe closer to if I want to break
up this piece.
But I want it more broken up towards the top than the bottom.
I'm going to move the emitter kind of closer to that area and then redo this whole process again.
OK, so we all have a shattered piece of ground, ready to ready to simulate that is going to be specific
to the animation that we have like this punching through this hole here.
So we're going to have kind of a nice little hole here.
Hopefully this is the plan anyways.
And so it will be ready for the next lesson where we will, you know, have this all shattered.
And then we are going to actually run a simulation.
And I'm going to show you some more tips and tricks on how to do that efficiently.
Thanks for watching.