In this lesson, I want us to cover and create creating some Firefly's or lightning bugs swarming around
the scene and then they react to the ground explosion.
So there's two different ways we could go about doing this.
One is using in particles, go to effects and we go to the in particles setting.
We could create Omidyar's and then we could create different fields to control them over here.
But instead, what I'd like to do is use a newer kind of feature.
And Maya, which is the mesh network, specifically the dynamics version of MASH, which is essentially
an unknown particle system, and Maya has repackaged it and is using it with MASH.
So we've kind of used in particles a little bit already and we've also used a little bit of mash and
prior lessons.
And so we're going to dig a little deeper into MASH now.
So let's create a new MASH network from a piece of geometry and for our fireflies, I'm just going to
use a little sphere.
And so I'll call that the base firefly.
And I'm just doing that on the outliner off the screen here.
You could also change it here.
And then we are going to go to MASH, Create MASH Network and let's open up the option box and we're
going to choose an instant here and scrunches a grid formation here and I'll hit applying close.
So I'm going to focus in on the extensor and isolates like that.
So now we can kind of see that a little bit better.
And the next thing I'm going to do is open up the MASH Waita.
So I'm going to go to the Ashbery Ed with the MASH kind of node selected here.
I'm just going to go and dock the outliner over here because I think we're going to keep coming back
to that and then also open up the mash ed here.
So that'll kind of be the outliner for the MASH network so we can kind of keep track of what we're doing.
So now we can see by default what we have created here.
And it's pretty basic.
It's a grid and we have a long way to go, but not that long.
So we have a little bit more work to do to make some Firefly's here, so let's look at the next thing
we're going to do is create a bigger grid.
So let's go to distribute.
And this is basically going to be the base for how many fireflies are going to be in our scene.
So we need to make this quite large, because if you remember to the same scale that we've set this
to is real world units.
So the scale is going to be quite large here.
So, yeah, let's just start with something like this, and that's quite a bit you might not need that
many hours to maybe like 500.
Let's see if that's something appropriate.
And I'm kind of checking with this view on the left side, too, because that's our render cam view.
So that's really going to dictate what we really need.
I'm going to turn off, isolate, select here for one second so I can you see this in perspective mode.
So it looks like we have too many, maybe vertically, so we can crank this down and then we can maybe
expand out a little bit more on Z and X, and we're going to reduce this even more with some more nodes.
So, yeah, it looks like we're covering that entire area now.
So now what I want to do is add a visibility node.
So let's go click on MASH.
You can click on it from the MASH Ed or Outliner and we get back to this in the appropriate editor here.
And you can get to that story editor with this button as well.
So let's create a visibility node here and we can just left click and say add a visibility node.
So it'll take a sliver of that.
And then we just reduce the random strength to go ahead and add a new shader to this so we can see it
a little bit better.
So click on the base Firefly, the original that we use that is hidden.
And by default, when you use MASH and just get that selected, isolate it and I'll just right.
Click in here and say assign new material.
And for now I'm just going to say a surface shader and crank that to white.
So we can see that.
And sometimes Maya doesn't want to update the shader stuff.
So sometimes opening the hypercharged, you can see it fixes that.
So that's a bug that they probably already fixed by now.
But and yeah, that's you always have to kind of look for workarounds in Maya.
So we have the visibility node and that's kind of helping us create a more random pattern of Firefly's
here.
And it's something that we can animate.
This is what's so powerful about MASH is we don't have to go, you know, sphere by sphere and turn
them on and off.
We just have this one slier that controls all of them.
And if for some reason we don't like this orientation, we can just change the random speed and that
will affect this random strength and apply it differently, but keep the same amount of strength.
So really, we can just kind of dial in exactly how much we want to have here.
And then the next thing we can do is add a random node so it'll change this even more.
Because, you know, even though this is randomly changing the visibility of what we can see, it's
still you know, these two are in a line here.
You can kind of see they're still you know, there's two here that are in a line.
So we want to change that by going into random position and maybe doing something even more drastic
and.
Yeah, something like that, so they're a little more random and might bring back some of these because
it looks like the left side's a little empty.
So I'm going to maybe change the seed here as well.
That looks a little better filled out.
And I might increase the distance to the camera because I don't feel like we're getting any like right
into the foreground of the camera.
We can see the cameras here.
So be nice to get some all the way to the camera.
We could add a transformer and just move all of these forward.
But instead, I think I'm going to go back to distribute node and increase the Z distance here, as
you can see that expand.
Hopefully you can see that on your screen and said expand as I do that.
And we can kind of get the Firefly's to go all the way to the camera.
And I might.
Dial that back and do a transform just so you can kind of see all of it.
So out of transform note, I'm going to command click Middle Mouse Dragon here and we can just drag
that value up.
So it kind of favor everything towards the camera a little bit when you go back to the remote cam.
Now you can see there's a firefly here really close to the camera and we can always go back into this
base geometry that we used and it'll scale down all of these.
The other thing we could do is actually use random for scale.
So it's a uniform scale and we can have a random scale value set to these.
So that's another option.
We might just do that just a little bit, that variability.
But in general, I think fireflies are pretty similar size.
And so now we have you know, nothing's moving yet, nothing's animated.
But what's really nice about this, again, is the fact that we can go back in and adjust this stuff
on the fly as we're changing, you know, on the fly, no pun intended, as we're changing stuff, we
can, you know, change the attributes downstream and everything, just kind of updates really fast.
This is what's really nice about MASH and the fact that, you know, we're not having to really simulate
anything here yet.
And within particles, we would have to be simulating already to get to this stage.
So it's kind of nice.
We can set up basically the particles, the instances that we're going to be using and then add dynamics
after the fact.
So let's go ahead and add some dynamics.
So I'm going to go over here and say add dynamics, and that's going to give us a whole slew of things.
And you can see it's setting it up and there's a lot of particles.
I think it takes a minute.
And let's look at our outliner.
So by this stage of the course, we're very familiar with a bullet solver now.
And so it's the same kind of setup here.
You can see the start frame.
Everything that we've learned up to this point, we probably can just turn off the gravity here because
we want these guys kind of floating around in space so we can hit zero on that.
And then what we want to do and how we want to control this stuff then is by using fields.
So if we click on dynamics here, that gives us another kind of option.
And if this stuff, you know, let me just turn back on the gravity just so you can kind of see what's
happening.
And I am going to increase that because of the the scale factor of the scene.
You can see everything just kind of falls down to the ground and the ground by default is actually a
negative 20.
And you can see that here.
So we could actually just bring that up if we wanted to see everything hit the ground that we have established
here.
So we should be able to start to see things at the ground.
And but, of course, we want our Firefly's to fly.
So that's why I was saying we can just turn off the gravity.
But I want to see I wanted you to see kind of what happens just out of the box here.
So when I go back to frame zero here and yeah, everything's looking good and now I'm going to go to
the dynamics tab and I want to show you that we have this kind of section down here for Fields sorry,
that's in the the bullet solar panels here, back in the bullet solver.
We have fields here so we can connect them, but we can't create them from in here.
So what we need to do is go ahead and create them.
And we don't want anything selected when we create the fields.
Otherwise we might get an error because it's trying to attach a field to something that we have selected.
So we just want to make sure we don't have anything selected outside of turbulence field.
And this is basically going to be a kind of noise through noise, through our simulation here.
And with that selected, we're going to really need to crank up the magnitude.
And let's start with like 500, right.
To do like 5000 at some point.
But let's say play and let's go back and make sure we have the gravity turned off here.
And we have no gravity.
We have OK, all of that set fine.
But the one thing we didn't do is actually add that turbulence field to the board solver.
And also, you know, while we're looking at the BOLSOVER, we do need changes subframe to one thousand
one here.
And we don't really need to do any Prioleau with this because it'll just kind of all be working from
the first frame.
So there's no pre roll that we need to worry about.
And so now we can go the bolts, hover and mouse, drag the turbulence field into the fields.
Little window here.
So now it's actually connected this field to that bolt solver.
All right.
So now we press play.
We should get some a little bit of.
Jiggling motion here, and it looks like it's doing a little calculation there and now it's starting
to go and I think we're going to need to really crank up the turbulence field.
So let's go back and crank up the magnitude quite a bit.
And just for right now, I think I'm going to reduce the grid size so we don't have as many particles,
so I'm going to just remember these settings and I'm going to reduce them down a little bit because
it's making our simulation quite, quite a bit slower.
So crank up the scale.
This guy, just so we can see it.
And then let's go to the turbulence field and let's just add a zero here and see what that does.
Because remember, the same scale that we're working at is quite large.
And yeah, we got some movement here, but not a ton, so on that another zero to add two zeros until
I get closer to what I want.
So now you can see check this out.
We're getting all this free animation and everything is moving kind of on its own, kind of course,
here.
And it's pretty awesome.
And so we're getting all this free animation.
Essentially.
The one thing I want to be aware of, though, is the fact that I don't want any Firefly's.
I mean, they could hit the ground.
They're going to end up being much smaller than the size that we're seeing here.
So if you don't want them to hit the ground, you could just add another field so you could go to the
field sollers and add a you can add a uniform field and then just say in the Y direction, you know,
shoot it up magnitude by like 10000 or something and just, you know, keep all the particles off of
the ground.
So let's just go and do that real quick.
Well, let's say uniform, and because I have something selected, it's giving me an error.
So make sure you don't have anything selected.
Go to uniform.
And then we want to have a huge magnitude here because we're keeping in mind the scene scales is quite
large and then we can create a volume shape so we can kind of control where it's happening.
So let's create a cube and then scale it way up and then let's scale it in the.
In these directions, because we want to keep it low to the ground, basically, it's just going to
kick any kind of particle that gets close to the ground.
It's going to kick it off the ground because I don't want these things like landing and sliding around
on the ground and looking weird.
So now we just need to connect it to the board solver.
So.
All right, Millimoles, drag this rather from outliner into here.
So now those things are connected.
So if any, we can actually play this back.
Let's take a look at this particle right here.
Should get shot upward.
So I play.
So watch this.
Oh, you know, what's happening is we didn't set the direction yet, so, yeah, all these parties
are going.
Let's see what direction they're going in.
If we hit the uniform field, the default is X, so again, X, Y, Z.
So let's hit zero.
Let's go.
Positive one.
We want to go upward and let's try it one more time and follow this particle again.
So now it should go straight up, which it is.
So keep these off the ground.
And we can add some drag to the board salver so that they don't just go for forever or some dampening
rather, and that might help it kind of keep from just going into infinity.
We could also add just like a touch of gravity, you can just really play an art director stuff as much
as you want as soon as you kind of get familiar and comfortable with each of these attributes.
So with that done right now, I'm going to continue in the next lesson and actually create the animated
section of the fields where we will help control the reaction to the ground breaking up.
So I want all these fireflies to scatter like crazy when the ground breaks.
So in the next lesson, we will cover that.
And I will see you there.
Thanks for watching.