WEBVTT

00:00.300 --> 00:06.190
In this lesson, we're going to start to break up and shatter the ground to use in a simulation.

00:06.750 --> 00:10.830
So before you do that, I just wanted to follow it from the previous lesson where we brought in the

00:10.830 --> 00:11.610
Olympic cache.

00:12.060 --> 00:13.970
And so now we have kind of a duplicate.

00:13.980 --> 00:16.380
We have the Olympic and we still have the rig in our scene.

00:16.800 --> 00:18.090
So let's get rid of the rig.

00:18.090 --> 00:24.770
But the catch to that is because we've used the referenced rig, right.

00:24.780 --> 00:26.160
We have reference there.

00:26.160 --> 00:33.570
Again, we can go to file reference, Ed, and we can see that indeed, that's a reference rig.

00:33.580 --> 00:39.120
We can also tell by these little blue dots that's a reference to rig or a reference.

00:39.120 --> 00:40.890
You can reference models, you reference anything.

00:40.890 --> 00:41.840
But this is a reference rig.

00:42.540 --> 00:47.700
And if we were just to remove that now, it's going to take all of the shaders with it.

00:47.700 --> 00:51.780
So our Olympic cache will no longer have all the shares that we have applied to it.

00:52.200 --> 01:00.000
So the first thing we need to do is to import this so we can say file import objects from reference

01:00.480 --> 01:02.190
so it's no longer referenced.

01:02.670 --> 01:08.040
And we can see those little blue icons are gone and now we can delete this.

01:08.250 --> 01:12.210
And so when we delete it, it's not going to take the shaders with it.

01:12.210 --> 01:14.140
All the shaders down here are going to stay.

01:14.850 --> 01:21.120
So let's take a look at breaking up the ground when we've learned how to do this in the bullet physics.

01:21.210 --> 01:25.260
Kind of a couple of lessons at the beginning, but we're going to learn a new way.

01:25.260 --> 01:27.860
So I'm going to unreferenced this so I can actually select the ground.

01:28.560 --> 01:30.000
So we're going to learn differently.

01:30.180 --> 01:34.960
And this lesson is how to use particles to shatter this object.

01:35.350 --> 01:41.430
Now, we talked about this quickly and the previous lesson where let's take a, you know, a cube or

01:41.430 --> 01:42.510
something, for example.

01:42.510 --> 01:51.270
And if we drop it onto rotate this and let's just, you know, for argument's sake or for learning sake,

01:51.630 --> 01:57.960
let's say we drop this on its corner right here, smash right now, if we use the Chater tool and we

01:57.960 --> 02:05.580
can just pop that open, going to the effects and going to shatter like we've done previously, we're

02:05.580 --> 02:08.200
in this middle tap or solid shatter five pieces.

02:08.200 --> 02:09.880
Let's have no jaggedness, blah, blah.

02:09.910 --> 02:10.500
That's all fine.

02:12.060 --> 02:16.320
We don't need to delete the history, if you remember, need to go to edit delete by type history before

02:16.320 --> 02:17.040
we use this.

02:17.070 --> 02:20.370
So now when we apply, it should break this up into five different pieces.

02:21.510 --> 02:23.140
We still have the original Kamps.

02:23.140 --> 02:23.850
This was tie that.

02:24.390 --> 02:26.430
But so the point of this is just saying.

02:27.310 --> 02:34.240
You would expect if this tube fell from a certain height and it hit the ground like this right in this

02:34.240 --> 02:43.060
orientation, that this corner, at first you would expect it to shatter more at the point of impact

02:43.060 --> 02:44.690
and less as you go up.

02:45.220 --> 02:48.070
But with this tool, there's no control over that.

02:48.070 --> 02:48.380
Right.

02:48.400 --> 02:51.920
It just shatters it in like evenly sized pieces.

02:52.450 --> 02:56.230
I mean, it's kind of nice because they are, you know, at least pieces.

02:56.230 --> 03:02.410
But like, it doesn't respect the fact that we want a higher concentration of pieces down here in the

03:02.410 --> 03:03.160
U.S. at the top.

03:03.670 --> 03:07.300
So there is a special kind of work around that we can do.

03:07.760 --> 03:10.390
We can delete these and it doesn't involve this.

03:11.350 --> 03:16.060
Well, you know, let me take that back when you could do let's say that's the case.

03:16.060 --> 03:21.410
You could take this and keep applying this to it so we can chunk it down even more.

03:21.790 --> 03:25.960
But this tool is very finicky, to be honest.

03:25.960 --> 03:26.710
It's of terrible.

03:27.640 --> 03:31.930
So if I had a you can see that, you know, we get our air.

03:34.270 --> 03:39.010
And so, you know, it could be Free's transformation's.

03:39.010 --> 03:40.860
It could be a history thing like this.

03:40.870 --> 03:43.030
You know, you have to delete the history every time.

03:44.920 --> 03:46.780
But, yeah, you get you get errors.

03:46.780 --> 03:48.010
And it's just a super annoying.

03:49.150 --> 03:54.580
But in theory, you should be able to keep chunking this down and like, break this up and then break

03:54.580 --> 04:00.250
up, you know, another piece into a smaller five more pieces and that kind of a thing in theory.

04:00.250 --> 04:03.220
But it's just this tool is kind of terrible.

04:03.220 --> 04:07.990
And there's another there's there's another way and it's not super.

04:08.320 --> 04:11.770
It's not a built in way necessarily, but it's kind of a hack.

04:12.160 --> 04:19.450
But we also get it to introduce to another effects kind of system, and that is in particles.

04:19.450 --> 04:27.310
And you can see up here everything has been in in here and constraint in cash and they all share similar

04:27.310 --> 04:28.050
components.

04:28.090 --> 04:34.390
So like each one of these is going to have a nucleus and a nucleus holds, you know, important information

04:34.390 --> 04:39.630
for like what's gravity like, you know, what framed as a simulation start and stuff like that.

04:40.030 --> 04:46.690
So it has this in because they used to call this in dynamics and the tab instead of it saying FXE used

04:46.690 --> 04:47.740
to say in dynamics.

04:48.220 --> 04:51.160
So it's kind of a holdover and like the old name.

04:51.730 --> 05:00.100
But so basically what we're going to do is, is use particles to concentrate and use particles to say,

05:00.280 --> 05:03.730
you know, wherever these particles are, that should be a piece.

05:04.180 --> 05:10.270
And if we emit particles from the point that we want it to shatter from, there will be a higher concentration

05:10.270 --> 05:15.550
of shards and fractures at that kind of point where the particle emitter is.

05:16.120 --> 05:17.790
So let's just jump right into that.

05:17.800 --> 05:18.870
So that makes more sense.

05:18.880 --> 05:20.800
We'll go to and particles create a matter.

05:21.490 --> 05:25.990
And in the outliner, you can see we have that nucleus that I referred to.

05:25.990 --> 05:30.510
We have the actual emitter that's going to do the emitting and then we have the particles themselves.

05:31.060 --> 05:36.580
So for the nucleus, the one thing we need to look at is the star frame, because we are let's go back

05:36.580 --> 05:43.150
to frame 101 because we don't need pre role for this is just kind of using this as like a tool, almost

05:43.150 --> 05:44.080
like a modeling tool.

05:45.100 --> 05:47.470
But you can use it for all different kinds of things.

05:47.950 --> 05:52.840
But so let's turn to the time attributes around the nucleus.

05:52.850 --> 05:57.730
Let's go to time attributes and get the start frame to frame 1001.

05:57.760 --> 05:59.110
So this will actually play back.

06:00.220 --> 06:07.150
And if we select on the particles, we just hit play, let's have four.

06:07.150 --> 06:11.080
Actually, let's at least move the emitter where it's going to be useful.

06:11.080 --> 06:14.660
So the whole point of this is to do it where the guys punching through.

06:14.680 --> 06:16.660
So let's go to the framers hands punch through.

06:17.260 --> 06:21.580
We have the emitter selected so we can actually move the emitter, which is going to be this little

06:21.580 --> 06:26.410
dot and this and it stands for the nucleus and it can be anywhere in the scene.

06:26.410 --> 06:28.940
That position of itself doesn't actually really matter.

06:29.440 --> 06:36.070
So basically, I just want to position this thing kind of in the kind of thickness of this piece of

06:36.070 --> 06:40.360
ground right where the hand is punching through.

06:40.390 --> 06:44.980
So we're going to have a higher concentration of shards right there.

06:45.250 --> 06:45.640
Right.

06:46.330 --> 06:47.110
It kind of makes sense.

06:49.320 --> 06:55.110
So we have that place correctly and lets it play and see what we can see with these particles, but

06:55.230 --> 06:58.680
first we want to go back to the start frame, which is frame 1001.

06:58.680 --> 07:02.250
So I'll go back to frame 1001 and I'll hit play.

07:02.730 --> 07:09.000
And now we can see all these particles emitting and the thing want to be careful about this effect that

07:09.000 --> 07:15.450
we're going to be doing is the fact that each one of these particles is going to represent a new shard

07:15.450 --> 07:22.080
and this volume, a new fractured piece and the more particles you have.

07:23.060 --> 07:28.700
It gets very intensive, I just I just tested this and it took like maybe an hour and a half to do when

07:28.700 --> 07:34.370
I had like 300 particles in the sand, it took like an hour and a half to cut up this piece of geometry

07:34.370 --> 07:35.420
with these particles.

07:36.230 --> 07:39.170
So we want to reduce the amount of particles we're actually emitting.

07:39.170 --> 07:42.260
So let's go to the emitter and we can go to the rate.

07:42.590 --> 07:46.670
And we just want to take this way down maybe to like 10.

07:47.060 --> 07:51.130
And by default, your speed is probably at one.

07:51.140 --> 07:52.430
And I cranked mine up to ten.

07:52.430 --> 07:57.680
That's the other thing you might want to change because of the scale we're working at, one is going

07:57.680 --> 07:58.750
to be way too slow.

07:59.270 --> 08:01.640
So you want to make sure your speed is cranked up.

08:02.210 --> 08:08.870
And the other thing is by default, we we do have gravity working on it.

08:09.470 --> 08:14.450
So I'm going to try and escape and turn off gravity because we're just trying to get particles emitted

08:14.450 --> 08:14.630
in here.

08:14.630 --> 08:17.570
We're not trying to, like, be physically accurate at all.

08:17.960 --> 08:25.010
So the gravity waves in the nucleus, so we can just turn down gravity or we can just turn the direction

08:25.010 --> 08:25.640
to zero.

08:26.180 --> 08:36.470
So these particles just kind of emit into like a bit, you know, just kind of like they're in space,

08:36.470 --> 08:37.070
basically.

08:38.750 --> 08:45.680
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

08:45.680 --> 08:47.750
going to select the particle here from that letter.

08:47.750 --> 08:51.890
So it kind of highlights that I can kind of see the concentration here.

08:52.400 --> 08:59.560
So it's a decent amount and I think it's going to get us like a good starting point.

09:00.380 --> 09:08.030
So now we need a way to tell Miah to take these particles and use them as the center of new pieces for

09:08.030 --> 09:09.440
this piece of geometry here.

09:10.280 --> 09:15.170
So before we do that, we need to go through all the cleaning up of this piece so we can see that there's

09:15.170 --> 09:18.260
some history here and it's not frozen, transformed.

09:18.260 --> 09:22.200
So let's go modify, freeze transforms, let's go edit, delete by type history.

09:22.670 --> 09:22.970
All right.

09:22.970 --> 09:24.230
So now it's all clean.

09:25.610 --> 09:28.550
So for this tool to work, it's actually a script.

09:28.550 --> 09:36.380
I'm going to make it available for you in either a war document attached as a resource to download with

09:36.380 --> 09:37.280
all of these files.

09:38.180 --> 09:39.290
Most likely that's what it's going to be.

09:39.300 --> 09:42.530
It's going to be on the floor with all the other downloads.

09:42.560 --> 09:43.790
It'll be a text document.

09:44.210 --> 09:50.710
And its credit goes to Malik Williams, who created this almost 10 years ago.

09:50.720 --> 09:56.090
You can see I found this in a very obscure like page 15 on a forum.

09:56.840 --> 10:05.540
But Voronoi is a type of shattering effect that he basically made this script.

10:05.930 --> 10:13.430
So and any time you're doing Mel scripts, so that's my expression language you can see down here in

10:13.430 --> 10:14.870
the bottom left, it says anyo.

10:15.230 --> 10:20.040
So I got to start typing in all this code in here and run it from this little area.

10:20.420 --> 10:25.840
So any time you're using Mel and it has these two dashes, that means this isn't going to run.

10:25.850 --> 10:27.730
This is just for your information.

10:28.010 --> 10:31.910
So if you're curious about how the script works, you can actually just look for these little things

10:31.910 --> 10:34.820
and it's going to explain what each section is about.

10:34.820 --> 10:41.000
And this is just because he's a friendly guy and took the time to actually write this stuff out to explain

10:41.000 --> 10:43.340
what he's doing, he could have easily left this stuff out.

10:43.820 --> 10:46.040
So you can look at each little section.

10:46.040 --> 10:49.040
He's kind of explaining what each little piece does.

10:49.430 --> 10:55.070
And this is how a lot of people learn how to do scripts and learn Mya's get scripts like this and they

10:55.070 --> 10:59.090
kind of break it down and figure out, all right, what what is each little piece doing?

10:59.360 --> 11:02.740
So for us, all we need to know is, are we just going to copy paste this?

11:02.750 --> 11:04.280
You don't really need to know how it works.

11:04.850 --> 11:08.480
So we do he does have instructions here.

11:08.510 --> 11:11.420
He says select the particles and then the geometry.

11:11.730 --> 11:12.110
All right.

11:12.110 --> 11:13.310
And at zero for crack.

11:13.430 --> 11:13.820
All right.

11:13.830 --> 11:16.190
So we'll see, like the particles first.

11:16.310 --> 11:17.300
It's like the geometry.

11:17.300 --> 11:24.380
And then we can just paste that script here and hit enter and we're going to get this little dialog

11:24.380 --> 11:26.990
box and we want to set the crack to zero.

11:27.690 --> 11:29.850
So the distance between the cracks is zero.

11:29.870 --> 11:36.650
So now when we look at this thing, we can see that indeed we have this kind of fracture that is going

11:36.650 --> 11:41.450
to work with where we actually have an impact on this piece.

11:42.650 --> 11:45.050
So we can do this multiple times.

11:45.050 --> 11:51.920
And that's what I'm going to do, because, you know, if we were to do this for this whole piece and

11:51.940 --> 11:56.600
with one particle system in one go, like I said, it would take a very long time.

11:56.600 --> 12:03.590
But what I what we can do now is just keep repeating what we just did on each different shard so I can

12:03.590 --> 12:10.310
go back and move the emitter to a new location, you know, somewhere maybe closer to if I want to break

12:10.310 --> 12:10.970
up this piece.

12:10.970 --> 12:14.000
But I want it more broken up towards the top than the bottom.

12:14.900 --> 12:21.710
I'm going to move the emitter kind of closer to that area and then redo this whole process again.

12:21.840 --> 12:30.920
OK, so we all have a shattered piece of ground, ready to ready to simulate that is going to be specific

12:30.920 --> 12:33.860
to the animation that we have like this punching through this hole here.

12:33.860 --> 12:35.900
So we're going to have kind of a nice little hole here.

12:36.260 --> 12:38.720
Hopefully this is the plan anyways.

12:39.320 --> 12:44.720
And so it will be ready for the next lesson where we will, you know, have this all shattered.

12:44.720 --> 12:48.530
And then we are going to actually run a simulation.

12:48.530 --> 12:52.160
And I'm going to show you some more tips and tricks on how to do that efficiently.

12:52.220 --> 12:52.910
Thanks for watching.
