Well, friends, in this chapter we'll talk about dynamics inside Cinema 4D,
and this will probably be the most fun and creative chapter in our course.
This doesn't mean that the other chapters are boring and uninteresting; at least, I hope you don't think so.
It's just that dynamics itself is, you know, like an endless sandbox that you'll never get tired of playing in.
But before we move on to the practical part, let's introduce some terminology.
First of all, what do we mean by the word "dynamics"?
Dynamics is the interaction of some bodies within the program. By bodies, I mean geometry, of course.
And it's divided into several types.
The first type is rigid bodies.
Again, if we refer to the list of references I prepared for you,
here in the top left corner, I have an example of working with Rigid Bodies, and we will definitely recreate it together.
So, what characterizes rigid bodies? They have no deformation upon interaction.
That is, when one body touches its neighbor,
first, it cannot penetrate it, which is simply impossible according to the laws of physics.
And also, it cannot deform it.
The second type of interaction is soft bodies.
And, accordingly, this is simply the opposite of the first option, meaning that some deformation occurs.
Mostly, it occurs under the influence of some external forces. For example, if you look at this setup,
what do we see? The spheres, most likely under the influence of some gravity, start pressing on their neighbors, the neighbors in turn press on those pressing on them from above, and you get these cool geometric distortions, which also look very, very nice.
Also, your soft bodies can interact in a different way.
On the contrary, if you don't account for any forces, if you have no gravity or turbulence, you can simply add pressure inside the soft bodies.
Basically, inflate it like a balloon.
And because of this, the walls of your objects begin to expand and also deform their neighbors.
In general, it's visually difficult to distinguish one type of interaction from another, so we won't separate them; we'll just call it all soft bodies.
The next type of interaction is cloth. In fact, it's very similar to soft bodies.
So, what we see is that there is also some deformation, but it will mainly occur on thin objects.
This doesn't mean that a sphere, for example, can't be cloth, or some volumetric object.
No, not at all. This is just a simplification.
In fact, any object in the program can be both a soft body and cloth.
And finally, the last type of interaction is ropes.
We also see deformation. The only thing that characterizes ropes is that you are working directly not with polygons, but with splines.
So, ropes are calculated at the spline level, while all the previous types of interaction are calculated at the polygon level.
Now let's switch to Cinema 4D.
I also suggest you open the file that will be called Rigid Balls.
By the way, I took all these assets from our Asset Browser. You can just type "ball" in the search bar here and you'll find the same balls without any problems.
So, my task is to simply make them fall somewhere.
That is, just turn on gravity, turn on some kind of floor level, and see how they will interact with each other.
So let's start with the basketball.
Look, to enable dynamics, that is, the calculation of dynamics on some object, you need to add a special tag to it.
To do this, we right-click on this object.
And look, we have two categories here that will be responsible for all the dynamics within the program.
The first category is called Bullet Tags.
It is now mainly used only for rigid bodies, although there is actually a Soft Body example here, and we will talk about this separately in the Super Cinema 4D Pro course,
because on its basis you can make very cool interactions of soft bodies, which, unfortunately, cannot be done on cloth and ropes.
We also have another new category, well, new relatively speaking, because it appeared a couple of years ago, which is called Simulation Tags.
This is the new dynamics calculation system.
Here we have Cloth, Rope, Soft Body is also here, and there is also Balloon.
Look, it's important to understand that these tags do not intersect with each other.
That is, if your object is a rigid body, you cannot set up an interaction with cloth.
It's impossible to make a rigid body interact with cloth.
Actually, it is possible, but we'll discuss that separately. It's impossible if it has this specific tag.
You have to understand that these are separate systems for calculating interactions.
A separate system called Bullet Tags, we remember in our heads that it is mainly used for rigid bodies.
And also a separate category, Simulation Tags, where we have Cloth, Rope, and also Balloon, which are these inflatable objects.
Since we are working with a rigid body here, we go to the Bullet Tags category and add the Rigid Body tag.
So, this is a rigid body that will be affected by some external forces.
Look, by default, you always have one global force enabled in the program: gravity.
Where is it located?
For this, you press Ctrl+D, in English, and go to your project settings.
You have two corresponding categories here.
Bullet and Simulation.
So these are the settings for rigid bodies and the simulation settings for cloth and ropes.
We go to Bullet here,
because we are working with that category.
And here we have, look, the Gravity parameter.
You see, it's currently set to 1000 cm.
Let's try to set it to zero.
Well, first of all, let's see what happens if we don't set it to zero.
Let's press Play.
And look, my body starts falling somewhere.
It's as if it was released and is flying off into free fall, somewhere into infinity.
If you want to remove gravity, you just remove it.
You say zero. I have no more gravity.
Then it will stay in place.
This means we can still influence it, hit it, and it will fly away, but you've essentially created a vacuum, a weightless space, let's say.
Let's put this back for now.
There is also an interesting parameter here called Time Scale. We'll talk about it separately, but just remember the parameters for now.
Time Scale allows you to slow down or speed up your simulation.
Okay, we have gravity,
we have falling, but I don't like that we don't have a floor, right? We're not accounting for these collisions.
For this, we need to separately tell it that this is also a rigid body.
Look, we go to the Plane, right-click, and also go to the Bullet Tags category.
Just an important note.
Look, if you add a Rigid Body tag to this thing too, it seems logical, right? There's a rigid body there, and a rigid body here.
And the first thing that comes to mind, you also add a Rigid Body tag here, press Play, and the whole thing flies off into infinity.
Look, a Rigid Body is an object that forces will act upon.
You don't want the force of gravity to act on the floor.
So we don't need this here. We add a separate tag,
also from this category, which is called Collider Body.
A collider, even from the icon, it's clear that this is just a body with which a collision will be calculated, and that's it.
It won't move on its own, and no forces will act on it.
We add it and check.
Bam, something fell there.
But you'll agree, this is all very boring.
I mean, I even see a small bounce, but this is far from ideal.
Therefore, let's go to the tag that we added to the basketball,
and let's change it.
Also, pay attention that when I run the simulation, the dynamics simulation only starts when you press Play.
And you can't scrub it forward or backward.
So it's a frame-by-frame simulation.
It's important to start from the beginning every time you make some changes. So you just press "Go to Start" here,
and press Play again.
You made some changes, again, pause and go back.
Okay, let's go to the tag settings.
Let's make it bigger.
Let's focus on just one tab for now, which is called Collision.
So, this is the tab that describes the nature of the collision with neighboring objects.
And we have several important parameters here: Bounce and Friction.
They are located at the bottom here.
Bounce is the bounciness of this object, Friction is the friction.
That is, friction against neighboring surfaces.
Well, in general, the friction is probably fine with me, it's a high coefficient here.
But the bounce is clearly small, 5%, and you can see it doesn't bounce at all.
There's no feeling that any bounce is present here.
Let's increase it. Let's make it, for example, 25 and see now.
Whoa, it's already better.
But it seems to me that this is more reminiscent of a soccer ball than a basketball.
So let's go back and make it, for example, 50% here.
So, again, we press Play. Oh.
And it's already more interesting, you see?
I think we can even do more. Let's make it 75%.
Whoa, this is very close to a basketball.
At the same time, pay attention that the ball can slightly change its angle and direction of movement upon bouncing.
Although, in fact, our plane is as flat as possible, there are no grooves, no dents.
This is because you have a parameter here called Collision Noise, which mixes in some random components at the moment of collision.
So when your object falls, it says, "Okay, you won't always be 100% up, this bounce vector might change a little bit."
And you can influence this, so you can put some large values here, then this impact, this bounce, can be, you see, more unpredictable.
Well, in fact, it's not necessary to increase this parameter too much, because now it seems that we've thrown the ball into a minefield where it's just jumping on these mines and bouncing off.
Let's go back. I'm deliberately increasing this parameter
to show it to you even more.
I'm telling you, this is a parameter that is very rarely used.
Just so you understand what it's for.
Okay, in general, I'm happy with this thing.
Look, in fact, the Bounce parameter can be set even higher than 100%.
And you will create non-physically correct interactions.
So look, what will happen if I set it to 150 here?
Look, bam, how far it flies away.
With each time, with each impact, you don't have a loss of energy.
On the contrary, you gain 50% more energy.
So here the law of conservation of energy no longer works, so this is more just for fun.
Maybe you'll take 100 such balls and throw them into your scene, and it will just be chaos.
Okay, let's reset.
Yes, by the way, of course, all this will work inside the Cloner.
So look, if I take this basketball, let's now make a Cloner here.
Okay, let's shrink it, make it 50 by 50 here.
So, a grid of these balls like this.
And just throw them, bam, you see, they fell.
So here now it doesn't like our bounce, because I reset it to the factory settings.
Let's return it to 75.
And again, you must replay it from the start.
So keep in mind, every time you change something, stop, go back to the start, and replay.
Well, this is much more interesting. Look how cool.
It probably makes sense, if you launch some objects into your scene like this, to also add a Random Effector to this Cloner.
Let's raise it a little bit.
And start it again.
And here, look how cool, they also collide with each other, bounce off.
They can fly somewhere out of bounds. Again, you don't want them to fly out of bounds, right?
You can just create a cube, for example, a big one like this.
Okay.
Convert it to polygons by pressing C, delete the top face in polygon edit mode.
So you select it and press Delete.
And in the same way, you added a tag to it, Bullet Tags, and here, Collider Body.
Let's check.
Press Play.
Look, they are already hitting these walls and not flying out.
Well, if you don't need this cube in the scene, if it's inconvenient for you to look at this scene, you can just hide it.
So, here again, we have created some kind of sandbox in which we just scatter these balls and watch how they interact with each other,
which is very, very cool.
Let's go back.
I'm deleting the random effector, I just showed you that all the same things work inside the Cloner.
Let's return to this ball.
It flew away somewhere, let's return it to our level.
Everything is clear with it.
Let's move on to our soccer ball, that is, the ball for football.
Again, I see some folder, I see some hierarchy there, an assembly of objects.
I'll just add it to the whole folder.
I want the entire object to fall under the influence of some forces.
So I want to affect the entire object.
Therefore, we also add Bullet Tags, Rigid Body.
Okay, and let's press Play.
And look, something strange is happening.
Some kind of body is bouncing off our ball,
the ball itself is flying away somewhere, it's not clear. So, clearly something is going wrong.
Look, this is because Cinema doesn't understand what you want to do with such a complex object that consists of several levels of geometry.
So everything is clear when you have one level. You just make it the main dynamic object.
But here it doesn't understand this. It thinks you want all these objects to also be rigid bodies.
So look, you have a separate object with these seams, or what are these... these sections that kind of stitch together your ball.
Then you have this section separately.
This one separately, a separate disk somewhere inside, it's not even clear where it is.
And all of this is now considered as rigid bodies. Accordingly, when your rigid bodies are in one point, Cinema doesn't understand what's happening, it doesn't understand how two rigid bodies can intersect.
And it just pushes them apart.
Because of this, you get this kind of explosion, right? Bam.
So, to prevent this from happening, look, inside this tag, you have a parameter at the top, Inherit Tag.
So, how does the inheritance happen? Inherit is the verb "to inherit".
So, here it's currently set to Apply Tag to Children.
So we are applying this tag, in fact, copying it to the entire internal hierarchy.
But we can say Compound Collision Shape.
Such a complex name, it means a complex collision shape.
So just take it, merge it all into a single object, and treat it as a single whole.
We select Compound Collision Shape and let's check now.
Press Play.
Well, look, it's much, much better.
Although something still flew out of there. Some object of mine here is not clear.
Let's delete this disk. I think it's just extra here.
Okay, press Play again.
Well, I still don't like how the ball behaves.
Let's go into this tag, add some bounce here. Let's make it 35% bounciness.
Press Play again.
Well, this is closer. Maybe 45.
Yes, 45 is close.
Maybe even 50.
Well, this is really just some microscopic changes now.
So, you see how the Bounce parameter affects the bounciness of our objects.
Next, we have a bowling ball, and it's clearly very heavy.
By the way, it's very heavy not only in terms of its weight, if I enable the grid here, it's also quite heavy in terms of geometry.
Because it has this Subdivision Surface object.
And look, what is the logic within the work with dynamics?
By the way, this applies not only to rigid bodies, but to any bodies, any surfaces.
The fewer polygons, the easier the calculation. And faster, accordingly.
So if you make a 3 by 3 grid here, like this,
and add a simulation tag, Rigid Body, to this whole thing... sorry, Bullet Tags, Rigid Body, then it will most likely even lag a bit for you.
Let's check. Press Play.
Well, it's not lagging that much now, we just have one object, but in fact, this significantly slows down your simulation time.
So my advice to you is,
if there is a possibility, calculate this whole thing on some less high parameters.
So here you can put 1 by 1.
Like this.
In general, the shape hasn't changed, so I'm fine with it.
Let's move away.
Press Play.
Well, maybe you can add a little more, let's make it 15% here. A slight bounce.
Okay, press Play again.
There, it's slightly... slightly bounced up.
And stopped.
Okay, so these are the main parameters that we need to start the dynamics.
Further, you can just practice and apply this to anything.
Just keep in mind, if you have an internal hierarchy, you need to consider this Inherit Tag parameter.
If there is no internal hierarchy, then it's simpler, you only need to play with the Bounce parameters.
Yes, pay attention, let's now for a second remove this cube, which is essentially my invisible wall.
Look, while this dynamics calculation is running, you can interact with other objects.
You can't interact with the ball now, that is, I can't select it and move it, because it is controlled, its entire transformation is now set, in fact, by this dynamics.
But I can take, for example, the rigid body Plane, which is a collider, and start rotating it. And look what will happen. You can directly, like this, live, see, influence your objects.
Look how cool.
I probably should have kept this cube.
Let me undo this for a second.
I can even add a special tag to it.
My advice to you is to add a Display tag to such collider objects.
There is a very convenient mode here for it.
Let's enable the display mode Lines.
So you see, it just shows you the wireframe of this object.
This won't affect the render in any way, of course.
Okay, and let's now increase the number of our balls.
So we can just take them into a Cloner.
Like this, bam, put them into the Cloner.
Okay, lifted it up.
For the Cloner, let's make it smaller, let's make it 25 by 25.
Look, the main point is that at the very first moment of time when you start the dynamics, you have no intersections.
I've actually already shown you this with the example of the soccer ball.
So look, if you have a situation like this, let's make it 10 by 10 here. Well, it seems, why not, right?
You press Play, and you will instantly have a dispersal of these objects.
So you see, they are flying apart, as if a mini-explosion is happening.
But you wanted them to just fall.
This is precisely because the objects are intersecting.
So, always when your objects intersect, you create such a mini-dispersal.
In fact, you can play with this, so you can put a randomizer here, you can shrink them down to zero, make it 0, 0 and put 5 by 5 copies here.
So you see, they are all, in fact, squashed down to one point, and when you press Play, you will have a real firework of these objects.
Sometimes it lags a little, nothing to worry about, you just need to wait a little.
Well, I hope it will come to its senses now.
There, you see?
Maybe in the Cloner it makes sense to put Render Instance.
Let's try playing it.
Well, that is, now it's very difficult for it to calculate, because the initial velocity at the first moment of time, it, in fact, tends to infinity, because they are compressed into one small point.
So, of course, you don't need to do that, it's enough to put a gap of, I don't know, 20 centimeters.
Yes, let's go back.
And in the same way, press Play.
Okay, but you see, Render Instance somehow works poorly here.
Let's go back to the regular instances.
Okay, one more time.
Well, yes, you see, it became much better this way.
So, here, I'm telling you, you can literally sit and rotate this plane while the playback is happening.
If you don't have enough time here for playback, just increase it, make it not 300 frames, but, for example, 600 or 1000.
Like this, you start it, and look, let's now rotate this thing.
And look how cool. So you can create all sorts of cool systems for rolling objects.
Further, you can create some, you know, portals into which these objects will roll, get sorted.
So here you can come up with some completely crazy things.
Okay, let's stop this.
And also, all this works in animation.
So if you animate this object, that is, for example, you want them to fall first, some time passes,
and let's say at the 60th frame, I can move my playhead here,
I want to animate this rotation angle.
So we set a keyframe here, bam.
It remembered this parameter.
And we move to the 90th frame, that is, after one second, we take it and rotate it by 45 degrees.
And fix this.
Okay, we go back and check.
Bam, they fly apart, and then they just took and slid off.