In this lesson, it's going to be a little bit longer because we're going to actually do the destruction
for this ground so that it matches the animation.
So before I get started with that, I wanted to finish talking about the particle system we use to break
this up.
You can see how much I had to break it up.
And I wanted to show you why when I didn't break it up enough, you can see where the chunks were too
big.
And as I collided the proxy geometry into it, it even started to affect the bottom part of it here
towards his feet.
So you want to make sure you have enough geometry.
And one little trick if you're still working on that, or you can just use this scene as well that I'm
working on.
But if you want to do it yourself, one little neat thing I've found, too, was that you could actually
just simulate the particles for a few frames and then you can transform them around.
So we have the particles selected for.
So I can see them.
You can see I have maybe four particles and I could just keep moving these around and running the script
that we have here that we've copied and pasted in so we could transform just the particles around and
then run the script that I gave you for each piece that we wanted to do it.
So we'd select the particles like the piece and then keep going.
So we're done with that.
So I'm going to delete that.
And I also want to mention, you know, of course you can middle mouse drag anything you type in here,
like the script that you paste for the shattering effect.
If you had command to select everything in this meall script section, you can then middle mouse drag
it into the shelf on your custom shelf and make your own button for it so you can just click the button
instead of having to paste it in every time.
So now that we have that done, we want to create the bullet system here and we've done this before
on the other smaller lessons.
But also wanted to mention a couple of things that I noticed with that script.
It had some errant pieces of geometry, a little planes that I had to go in and delete by hand, but
I think I got all of them.
So you just want to look for that.
And then there's these random hidden pieces of geometry that I'm not sure why it would hide it.
So I'm just command clicking on the hidden pieces and deleting them.
So now that we have that done, let's select all of the shards that we've created and then let's go
to the bullet system and of course, we need to make sure that's loaded is always under settings, plug
and manager and bullet.
And we also want to make sure that we have the ABC bullet checked as well, because we're going to use
that here in a second.
So we have bullet and we want to create a rigid set like we've done before.
It's going to explode because we are not on the start frame.
Let's go back to what our star frame is going to be.
And you can see it still hasn't fixed itself.
So we need to click on the bullet solver and go into the attribute editor here and we get all of these
options that we're starting to get familiar with.
So we want the start frame to be what our start frame is.
And of course, the reason why it's on 1001, as I've mentioned before, is because we wanted some pre
roll for other dynamic effects.
The nice thing about Bullet is it has a initially sleeping option here, Senator Bullet, rigid set,
initial state, and we can check that.
And basically what that means is until something collides with it, it will stay the way it is, which
is really nice.
So let's go back to the bullet solver for a second and talk about the gravity.
So the gravity is important because it's going to affect kind of how the scale works on this scene.
So as you remember, Maya thinks one unit is one meter.
And in our case, our character is now 182 centimetres tall.
So Bullet Solvers is going to think that this is 182 meters long of a piece of ground here that we've
made.
And for that to have the right physics, we can just increase the gravity by 100.
So we can just make it, you know, times that by 100 and it'll be 980 instead of nine point eight.
So that will help us get to the correct scale of our scene so that everything will fall accordingly.
Now, let me show you what happens when you don't do that.
This is a test I did earlier and I set the I didn't change the gravity.
So you can see how everything is moving in slow motion and very slowly.
So we don't want that.
So now that we have gravity set correctly, it'll work.
And we don't want to use the ground plane because our geometry is actually just below the ground plane,
just below zero.
So we've made our own ground plane.
I'm at five so we can see it and it's down here and I move it just below the geometry here.
So it's not starting to collide with it at the very beginning.
And this is just going to be our, you know, playing our ground plane because that's below, you know,
zero is this plane.
And we wanted one that kind of goes in the ground.
So that's why we need to make our own ground plane.
So with that selected, I can go to Bulleit and set passive rigid body.
You might get an air and that's OK.
I'm going to just leave all of this the same, except for I'm going to make this a plane, which means
it'll go off in all directions.
OK, I'm going to maybe crank that down just a little bit.
And now we can also said this is a passive glider, so I'll use Bullet Pasturage body.
And instead of the plane, because this has a donut kind of hole in the middle, we can't use any of
the ones we've been using because they are kind of all intact versions.
So what we want is mesh.
And this will respect the fact that there's a hole in the middle so that we don't think it's colliding
in the center of this thing.
So it's like the mesh.
And then I'll reduce this by a little bit as well.
And mass is OK.
It's a static body.
And just in general know that static, rigid bodies are quicker to compute because they're not having
to compute changes in position, of course, because they're not going anywhere.
So now that we have those two things done, I also wanted to introduce this little guy.
I'm going to shift H and it's basically kind of a container to keep the ground from expanding out.
So let me just selecta those two things and isolate them so you can see what I'm talking about.
So you isolate selected the shards.
Let me select high.
Oh, it had everything.
Because now we're working at the so when you when you make Bullett it'll make its own piece of geometry
here.
So that's why I wasn't getting isolated, selected.
So now it'll work.
So basically just kind of keeps it all contained so everything can expand outward.
So that will help it kind of keep its shape as it's simulating.
So let's create another passive rigid body and like we did for the other ground, we want to make sure
that the Kliner properties is set to mesh the Claitor shape and then going to reduce this down all the
way.
Cool.
So let's go back to the solver.
Take a look at that.
We have our gravity set properly.
We have the start frame set properly, and we need to increase the mass as well.
If you think about all the physics of this, if you know we're having to.
Increase the gravity by 100 times, we should do that for everything, basically, but we can start
out with maybe like something like 10 instead of doing 100 times, let's do like 10 times.
And it's initially sleeping.
And again, we want to change this to whole like we've learned and other lessons and turn on glue shapes
and let's just crank that all the way up, because this will also be affected by the scale of seen and
gravity and all that.
So we need to increase the force of this because gravity is going to be pulling on it 100 times harder
than usual.
So this value might need to be even need to be a thousand or something later we'll find out.
So the next thing I want to do is to mimic the animation of the hand.
And I don't want to use the actual animation of the skeleton because it's a lot of geometry in here
and a lot of things could get stuck in between the fingers and in between the bones and all that.
And so what I want to do is actually create a new piece of geometry and I'm just going to create a sphere
and I'm going to move that into place here.
And with that selected, I'm going to scale it up and kind of scrub in a timeline to see where the hand
is coming through.
And I'm going to place this kind of in that general area.
And I'm going to leave it kind of scaled up like this, and just so it kind of has a healthy kind of
padding around it.
So it's this is basically what's going to be colliding with the rigid set that we've created.
So when I set out there, I'm not going to animate anything yet.
And this is another little tricky thing with the bullet you would learn anyways eventually.
But basically, if you animate this and you choose it to be part of bullet, then it'll delete all the
animation.
So we need to create an active body first and now we can do the animation.
But the other little thing that I mentioned before, I believe, is we want to switch is the kinematic
so it will respect the key frames that we set.
And then also I want to increase the mass and I want to be much more than the mass we've set for the
shards because it needs to overcome that weight and really push them out of the way.
So I'm going to set this to like something like 500.
So it's five times as much as the shards themselves right now.
I believe this a box, because that's just easier to compute.
And I'm going to leave the margin on for a little bit.
So now I can start to keyframe this thing.
And I have four just so I can see the animation beneath this.
And I'm going to step through this animation and make sure everything is going to be on the right frame.
Something else to set keyframes.
And five, to make sure I'm kind of reading the silhouette correctly here, maybe push this forward
and then let's take a look at under four again to make sure we're following the first.
And the other thing we need to know is the fact that with initially sleeping, if anything is kind of
intersecting anything, even if it's a static, rigid body and this is kinematic, it will trigger the
simulation.
So we need to make sure that this is not touching the plane.
Otherwise, initially, sleeping would not work for these Shahd sets and everything would start from
this first frame.
So currently what will happen is it will only start the simulation as soon as this fear that we've created
rams in to the first shard here.
So that's pretty cool.
So the next thing we need to do is continue this animation because the hand kind of comes down here
and we want to make sure that we're going to be able to see that somewhat.
So we need to continue this animation.
So I want to make sure I get the Antec of the hand in there as well.
It's going to get the first frame there and set it kind of keyframe.
And then get the antic in there, this frame.
And then we'll start this.
And we'll rotate it just a little bit, and I don't know why does this, but it kind of spazzes out
just some goofy thing that bullet does.
And I will say, I mean, of all the Sims and solvers you can use in my bullet is kind of can be a little
bit wonky sometimes and frustrating.
But, you know, if you get it done right away, it's pretty nice.
It's an open source software.
So Maya doesn't really support the, you know, from a technical perspective, doesn't really support
it.
So if you ask Autodesk for help, they're not going to really help you that much because it's not their
product, but it's an open source dynamic system that's basically meant for games.
But, yeah, Autodesk decided to include it as well, because I think it does have some use for, you
know, just trying to get some basic stuff simulation.
And you don't have to go through like a ton of crazy steps.
There are some finicky things here that we're learning about.
But, you know, in general, this isn't that bad really, as far as dynamics are concerned, to set
something up that actually kind of works.
So I'm trying to move that there.
OK, and then the next thing I'm going to do is create another sphere and make it a active body and
turn it back to kinematic, because this is going to be our body busting through.
So we increase that.
It's much bigger.
And of course, I want that below the plane again because I don't want it to trigger the initially sleeping
thing that we have set.
So I'm going to position this here and then scrub through the looks like it snaps back there.
Let's set a keyframe here, then.
Man, this is super wonky, sometimes you can see how I'm just clicking and snapping at it kind of to
another location.
Let me s and let's see if it's keyframes.
Cool.
It did.
So now with those key frames, it should kind of.
Yeah.
Now it's kind of respecting where I'm putting it.
So I just know that's kind of another little quirk of the system.
So now we can start scrubbing forward.
Someone here is going to start busting through right in their face when it?
S here.
And want to.
I'm going to push this through.
And I might get that to happen maybe a little sooner, because I'm also conscious of the speed of this
thing coming through, if it goes through too fast, this might not really catch it.
So I want to make sure it's kind of going through at a speed that the salver can kind of find it and
actually solve for that.
So, yeah, so now I'm just going to kind of follow this through again, maybe scale this up.
So it really kind of rocks the world here.
I don't really like how wide that is, that might cause other problems, let's maybe scale it in a little
bit and scale it in a little bit here.
Cool.
So now we have that and then we just kind of need to finish this animation out kind of tracking, because
I think, you know, when he's in midair, we don't want a piece of that shard to kind of be blocking
his face or something.
So I'm going to favor kind of his torso here.
And everything else should happen kind of fast enough that it won't.
You know, you won't be able to really tell if, like, a piece is like going through his arm or something
because it'll all be kind of happening so fast.
So we kind of use that to our advantage here.
All right.
Excuse me, it's been a long day at the studio working on a movie for a studio and.
My my voice is starting to go now recording these videos, so, all right, now we have this done and
what we can do is just go ahead and cash it out.
Like I said earlier, you know, if I were to hit play on this, I mean, we can just go and do that
once just to make sure it's not going to do something totally crazy.
But what I like to do, you know, when I realize it's kind of working is just go and cash it out because
bullet will not be consistent with the results.
So if you play it back and you see that you like what you've got, then you're out of luck.
If you play again and try to cash it because you're not entirely guaranteed the same simulation.
So everything looks kind of good so far.
It's going to be a little busy.
Things are kind of still moving around.
Cars work, and though I'll be honest.
Only a little goofy things of that peace is going to be blocking the hand, but you cannot direct this
stuff as much as you want by you know, you go back in and reanimate that hand or the sphere that we
have for the hand.
But in general, I think this is in a good spot.
So there's a couple more things we need to now that we're going to cash it out, because basically every
time we're doing something, we don't want to have this other thing solving every time that we play
back.
So we want to cash this out so we kind of save it and break it down to the geometry.
So to do that and bullet, we need to select the set that was made.
When we make a bullet solver, there's this little set that gets made and we want to make sure that
we do not go into cash.
You know, I'm saying we're doing caches.
You have to do an Olympic cache through the bullet menu.
Otherwise you're going to get a bunch of errors.
And so this is another kind of gotcha moment.
And Maya, do not use this cash bullet.
You have to use the bullet menu to export selection to Olympic.
All right.
And the other little gotcha moment is you want to switch to the HD five file format.
That's how bullet reads that it doesn't know this file format.
So we need that one and we can see our, you know, range is cracked and all that kind of good stuff.
So I'm going to choose this name for the Olympic and I'm going to export that.
And I'll see you in one second.
So now that our cash is done, we can actually import it and we want to make sure that we have this
chards group selected and with the shards groups like that, we can use this, let cash import now we
can use this to import it.
So it's going to import and we want to make sure normally it's set on this import tahseen.
We want to change it to merge.
So what is basically doing is it's going to assign these values to this group because it all has the
same names.
That's what that rigid set created, that each individual piece has a name associated with it.
So when it's cashing it out, it addresses that name to that piece.
So we're reassigning this animation in the simulation back down into the original pieces.
And so this you could actually use this to use low res geometry.
Right.
And then do the simulation with low res geometry and then have high res pieces of geometry that you
merge it on to so that when you're doing the simulation, it can be much quicker because you're using
low res geometry.
But then when you're actually going to use it as a cache in the scene, then you can use the high res
pieces and choose that group that would be associated with that.
Oh, that makes sense.
It's just kind of that's more of an advanced feature.
But just wanted to mention that's a possibility.
So now that we have that set, let's just delete the bullet system.
And when we don't want to delete it just by selecting it, we want to go to bullet and then delete entire
entire system.
So now we can play back, we can just scrub and we should be able to see all of this animation on our
original shards here.
So that is pretty cool.
So the only thing left to really say is the fact that, you know, we have some interpenetration here
on the hat and this so we could, you know, turn this into a passive rigid body.
We can make some proxy geometry like a sphere or something to, you know, guard this piece just like
we animated this.
We could use it as a static, rigid body, just like we're using the floor as a static, rigid body.
So all in all, it looks like it works pretty well.
We learned how to create a bullet semb and then cash it out and then re-import it.
So it's been a pretty big lesson here.
And I think this is going to prove pretty helpful down the road when you need to do a big simulation
of a lot of things.
So, yeah, this is just one way to do it.
And we will, yeah, carry on in the next lesson with learning some more dynamic simulations.
And Maya, thanks for watching.