WEBVTT

00:00.000 --> 00:04.720
Blender 4.2 has been released and I want to take the opportunity to go over some of

00:04.721 --> 00:06.560
the things that are new for geometry nodes.

00:07.340 --> 00:10.260
In this video, we'll take a look at the new matrix socket.

00:10.880 --> 00:13.139
There is also another video about what is new

00:13.140 --> 00:15.380
for node tools that you can check out afterwards.

00:15.880 --> 00:20.540
If you go to the release nodes page on blender.org and you scroll down to the

00:20.541 --> 00:23.624
geometry nodes section, you find that there is a whole

00:23.625 --> 00:26.600
new socket type in geometry nodes for matrices now.

00:27.140 --> 00:32.500
This little demo file here shows how this new socket can be used to handle

00:32.501 --> 00:35.580
transformations much more easily than was possible before.

00:35.980 --> 00:40.280
In this case, to make a little stacking modifier for this pile of pizza boxes.

00:40.780 --> 00:44.560
Let me first give you a quick introduction to what the purpose of this new socket

00:44.561 --> 00:47.508
type is, and then walk you through the creation of

00:47.509 --> 00:50.141
the modifier in this demo in a little bit more detail.

00:50.920 --> 00:53.060
So, what even is the point of a matrix?

00:53.061 --> 00:57.200
Well, there's a lot of mathematical background that can be covered when

00:57.201 --> 01:00.500
talking about matrices, but that's not really important right now.

01:01.160 --> 01:05.200
The most important thing to understand for using the matrix socket in blender's

01:05.201 --> 01:09.557
geometry node is that a 4x4 matrix is a very

01:09.558 --> 01:12.841
useful way to represent a transformation.

01:13.220 --> 01:15.260
That is also what blender does under the hood.

01:16.100 --> 01:22.000
A transformation in general is made up of the three components for translating,

01:23.160 --> 01:24.500
rotating and scaling.

01:24.860 --> 01:31.840
So, instead of thinking about a matrix as a grid or 4x4, which doesn't really help

01:31.841 --> 01:36.300
you to understand what exactly is going on, you can just think of it in the

01:36.301 --> 01:40.980
context of transformations of translation, rotation and scale.

01:40.981 --> 01:46.468
So, for that, the easiest way to create a matrix in blender's

01:46.469 --> 01:51.000
geometry nodes now is to use the combine transform node.

01:52.020 --> 01:54.784
There you simply get the option to plug in your values for

01:54.785 --> 01:58.720
translation, rotation and scale, and out comes the matrix.

01:59.680 --> 02:05.400
But you can also retrieve your transformation directly from, let's say, an object.

02:05.680 --> 02:10.040
So, here on the modifier of this cube, for example, let's drag and drop the

02:10.041 --> 02:14.900
camera object into the node tree, and there you can see that besides the

02:14.901 --> 02:18.158
object transformations for location, rotation and

02:18.159 --> 02:22.400
scale, we also get the transform matrix as one socket.

02:23.040 --> 02:26.456
This one transform socket now encapsulates all the

02:26.457 --> 02:30.120
transform information from these three individual sockets.

02:31.200 --> 02:34.140
And that can make it a lot easier to handle in the node tree.

02:34.940 --> 02:43.000
For example, if we now want to move the cube into the same transformation as the

02:43.001 --> 02:47.801
camera, we can very easily do that using the transform

02:47.802 --> 02:51.980
geometry node, and then setting it to the matrix mode.

02:53.020 --> 02:57.660
And then connecting the transform of the camera to the transform of the operation

02:57.661 --> 03:00.482
puts the cube directly into the exact same

03:00.483 --> 03:04.181
position, rotation and scale as the camera.

03:04.360 --> 03:08.180
So, if you move that around now, you can see how it's really constrained to

03:08.181 --> 03:11.540
the camera directly, all using geometry nodes.

03:12.840 --> 03:16.400
This would have been possible before using the location, rotation and scale,

03:17.080 --> 03:19.000
but it would have been a little bit more tedious.

03:19.480 --> 03:22.960
And with this transform now, we can also do some additional things.

03:23.880 --> 03:26.900
Like, for example, we can combine it with another transform.

03:27.580 --> 03:29.960
So, let's use the combine transform node.

03:29.961 --> 03:33.271
And then to do both of these transformations

03:33.272 --> 03:36.700
at once, we can use a multiply matrices node.

03:37.800 --> 03:41.620
Again, I'm not going to go into the mathematical detail of why this works,

03:42.320 --> 03:46.066
but multiplying two matrices basically just means

03:46.067 --> 03:49.260
combining both of the transformations in this context.

03:49.880 --> 03:55.720
So, if I plug both the matrices in here and then add some value in the

03:55.721 --> 03:59.458
translation, you can see how that also moves the cube

03:59.459 --> 04:03.380
on top of the transformation we did into the camera.

04:04.100 --> 04:10.000
But here, you can see that the translation vector that we plug in for a positive X

04:10.001 --> 04:15.340
value doesn't actually move the cube along the X axis of the object.

04:16.100 --> 04:20.300
And this is where the order of these two inputs comes into play.

04:20.301 --> 04:27.640
Since we have the transformation of the camera first, this means that this

04:27.641 --> 04:32.200
transformation happens in the space of the camera.

04:33.220 --> 04:37.480
So, we're currently moving the cube along the X axis of the camera.

04:39.620 --> 04:45.100
If I reverse the order of these two inputs, you can see how now this vector

04:45.101 --> 04:49.600
has an effect on the X axis of the cube object.

04:49.601 --> 04:52.647
So, this is something to be wary of when

04:52.648 --> 04:55.741
you're combining matrices for transformations.

04:56.600 --> 05:00.336
Another thing you can do, for example, to change

05:00.337 --> 05:03.800
the transformation around is to invert the matrix.

05:04.420 --> 05:07.820
For transformation, this also does exactly what you would think it does.

05:08.140 --> 05:11.980
It inverts the transformation by doing the exact opposite.

05:11.981 --> 05:17.861
These kinds of transformations between different spaces

05:17.862 --> 05:21.920
from global to local and between different objects, etc.

05:22.560 --> 05:24.700
can get quite complicated quite quickly.

05:25.240 --> 05:30.280
So, it's very nice to just combine the whole concept of the transformation in a

05:30.281 --> 05:35.480
single socket with simple applications rather than having to handle them

05:35.481 --> 05:38.120
individually as location, rotation and scale.

05:38.900 --> 05:44.680
Another aspect of this matrix socket is that it doesn't simply just work for a

05:44.681 --> 05:47.780
single matrix that is carried from these links.

05:48.260 --> 05:54.541
Since it is a whole new socket type, it can also be applied to fields and attributes.

05:54.760 --> 05:59.840
So, we can store a whole transformation matrix for each element of your geometry,

06:00.480 --> 06:02.560
for example, for each point of the mesh.

06:03.080 --> 06:06.540
This will come in handy in just a second when we go over the demo file.

06:07.760 --> 06:10.580
Alright, so let's get to stacking some pizza boxes.

06:11.480 --> 06:15.800
If you download the demo file from the release notes page, you can see that there

06:15.801 --> 06:21.820
is a relatively simple scene with this guy carrying pizza boxes on a Vespa.

06:23.140 --> 06:27.760
And there is just one modifier on the pizza stack that has some controls for you

06:27.761 --> 06:30.555
to control the height of the stack and then

06:30.556 --> 06:33.421
some additional settings for randomization.

06:35.200 --> 06:39.064
And this is heavily relying on the use of matrices to

06:39.065 --> 06:42.700
propagate the transformations between these different boxes.

06:43.860 --> 06:51.320
So, one thing, for example, is that as I increase this random rotation or the

06:51.321 --> 06:57.200
random offset, the pizza boxes don't just simply move individually.

06:57.940 --> 06:59.620
They all affect each other.

06:59.621 --> 07:04.360
So, just like on a real stack of pizza boxes, if I just draw a really crude

07:04.361 --> 07:11.380
example here, the orientation of the lower box will affect the ones above it.

07:11.780 --> 07:15.168
So, if there is a box with a slight tilt to it,

07:15.169 --> 07:18.941
the ones atop it will have the tilt as well.

07:19.720 --> 07:25.400
That was previously not that simple to do, but now with the matrix node, it's pretty

07:25.401 --> 07:31.640
easy to get the transformation of one element to affect the other ones above it.

07:32.220 --> 07:33.700
So, let's go over how that works.

07:34.740 --> 07:40.460
Another aspect of this example case is that you can see clearly when I crank up

07:40.461 --> 07:44.050
the number very high, there is a slight bounce that

07:44.051 --> 07:49.660
goes through the pizza stack as the Vespa is jittering.

07:49.880 --> 07:52.860
And this is actually going from the bottom all the way to the top.

07:53.520 --> 07:59.800
For that, it's also using the matrix socket in a very simple simulation setup.

08:01.140 --> 08:03.296
And of course, this can break the laws of

08:03.297 --> 08:06.821
physics to create this very fun-looking effect.

08:07.180 --> 08:09.280
So then, let's get to stacking those boxes.

08:10.200 --> 08:13.040
First off, we'll start with a brand new cube.

08:14.340 --> 08:18.362
There, I'll go into edit mode on and then scale it to 0.5

08:18.363 --> 08:22.900
size, because that means that each edge is exactly one unit.

08:24.260 --> 08:28.317
And then move it up on the Z axis by 0.5, which

08:28.318 --> 08:32.120
means that it's standing nicely on its origin point.

08:33.200 --> 08:35.240
That will be useful for the node setup.

08:36.200 --> 08:40.000
So let's start by creating a new geometry nodes modifier.

08:40.940 --> 08:43.200
Let's call that one pizza stack.

08:44.060 --> 08:47.220
And then now let's start by setting up the base for this stack.

08:47.221 --> 08:51.124
What I want to start with is a whole bunch of instances

08:51.125 --> 08:54.480
of this cube, which are going to be my pizza boxes.

08:55.800 --> 08:58.320
For that, I'm going to start out with a

08:58.321 --> 09:02.181
points node to give me a bunch of base points.

09:02.800 --> 09:04.480
Set that to 25 for now.

09:05.720 --> 09:09.040
And then an instance on points node.

09:10.160 --> 09:14.900
And what we'll instance as the geometry is going to be my input from the cube.

09:15.900 --> 09:18.874
And as you can see in the spreadsheet editor, now

09:18.875 --> 09:21.741
we end up with 25 instances of that same cube.

09:22.340 --> 09:26.238
So let's squish them a little bit more into pizza box shape

09:26.239 --> 09:29.880
by using a random value node and then tweaking the settings.

09:30.900 --> 09:33.999
So let's start with one on the XY axis, but go a

09:34.000 --> 09:38.620
little bit higher to have some more randomness to 1.5.

09:38.820 --> 09:41.740
And then on the Z axis, I want only low values.

09:41.741 --> 09:46.560
So let's go from 0.05 to 0.3.

09:47.200 --> 09:49.620
And then we get a nice variation of shapes.

09:51.080 --> 09:57.840
Now all of these different instances have their exact size as the scale.

09:58.580 --> 10:03.480
And that is something that we can simply use with the instance scale node.

10:04.840 --> 10:10.040
So this is where we get the information of the height of each of these cubes.

10:10.041 --> 10:12.640
And that is something that we'll need to create the stack.

10:13.220 --> 10:15.485
To get a better view of what we're looking at,

10:15.486 --> 10:18.801
let me just go into local view on this object.

10:18.840 --> 10:21.500
So how do we now get these boxes into the right place?

10:21.820 --> 10:25.298
The main node that we'll use to orient these

10:25.299 --> 10:28.501
instances is the set instance transform node.

10:29.060 --> 10:32.632
This one lets us directly set the exact transformations

10:32.633 --> 10:36.140
for all of these boxes using the new matrix socket.

10:36.141 --> 10:44.360
So if I now add a combine transform node, you can see that all of the scale that

10:44.361 --> 10:47.078
we've been randomizing before is now set

10:47.079 --> 10:49.760
back to exactly what is defined in this node.

10:50.540 --> 10:55.440
So let's combine the instance scale in there to make sure that we keep that around.

10:56.000 --> 11:00.200
And then the translation and rotation, we can just set to any other value,

11:00.540 --> 11:02.580
and those will be applied to all the instances.

11:02.581 --> 11:07.040
Now we just need to figure out where they actually should be for each instance.

11:07.900 --> 11:10.840
For that I'm going to show you a little trick that is very useful.

11:11.740 --> 11:14.040
Let's use the accumulate field node.

11:14.880 --> 11:21.000
So what this node does is that for a domain of the geometry, in our case that

11:21.001 --> 11:26.660
is going to be the instance domain, it goes through all the different elements

11:26.661 --> 11:33.400
within the same group, and then accumulates the values of a certain field.

11:34.540 --> 11:38.560
In our case that is going to be a transform field.

11:39.300 --> 11:41.620
So let's set the data type to transform.

11:42.280 --> 11:46.600
And then what that does is that this node will go through all the individual

11:46.601 --> 11:50.580
instances for these cubes, and then accumulate the transforms.

11:50.940 --> 11:56.480
So instead of each cube just knowing its own transformation, this will go through

11:56.481 --> 11:59.585
all of the previous ones and add them on top of each

11:59.586 --> 12:02.240
other, which is exactly what we need for this stack.

12:02.740 --> 12:04.020
Let me show you how that works.

12:04.480 --> 12:10.700
Let's connect the trailing output of this node to a separate transform node.

12:10.940 --> 12:15.680
And for this we only want the translation and the rotation, so we plug that into our

12:15.681 --> 12:18.860
combine node, because the scale is already taken care of.

12:19.140 --> 12:24.020
Right now the input for this accumulate field node is nothing, so we are not

12:24.021 --> 12:27.520
applying any transformation at all for each of these instances.

12:28.100 --> 12:34.020
But now, as I use another combine transform node to give me a matrix field,

12:34.420 --> 12:40.220
and I tweak these values, you can see how each of these cubes is moved a little bit

12:40.221 --> 12:46.300
more than all the previous ones combined, rather than just moving them all at once.

12:46.840 --> 12:50.680
And that is the same also for the rotation and the scale.

12:51.340 --> 12:56.540
So there you can see that it's very useful to just use the concept of a transform and

12:56.541 --> 13:00.000
the accumulation, rather than having to do all the math yourself.

13:01.020 --> 13:05.600
So all the previous pizza boxes are influencing the ones on top.

13:07.060 --> 13:12.100
So now let me just zero this out again, and then we can actually use the exact

13:12.101 --> 13:15.262
information that we have over the size of all

13:15.263 --> 13:18.460
these cubes for the translation offset of them.

13:18.461 --> 13:25.240
We only need the Z component, so let's use a multiply node and multiply it with the

13:25.241 --> 13:28.820
001 to cancel out the X and the Y component.

13:29.320 --> 13:33.040
And as we connect this, you can already see how this works perfectly.

13:33.720 --> 13:41.180
So what is happening right now is that each cube is being offset by the

13:41.181 --> 13:45.840
accumulation of all of the sizes of the cubes that came before it.

13:45.841 --> 13:50.780
So this cube is set exactly to the combination of the height of the two

13:50.781 --> 13:56.061
before it, and then the next cube is set on top of the three before it, and so on.

13:56.920 --> 14:01.980
And if I change the bounds of the random scale, you can really see how this works

14:01.981 --> 14:06.060
perfectly, even if I have very different heights for all of these cubes.

14:06.640 --> 14:11.160
And this is already a very useful little stacking setup that you can use in a more

14:11.161 --> 14:15.120
generic way for other applications as well, with just a few nodes.

14:15.760 --> 14:18.560
So now, let's give this stack a bit more variation.

14:18.860 --> 14:21.618
Let's frame this as our main stacking part of the

14:21.619 --> 14:25.400
modifier, and then also add some variation to the rotation.

14:25.740 --> 14:31.480
For that, let's simply just connect this to a random value node, and you can

14:31.481 --> 14:33.560
already see how it is crumbling up on itself.

14:34.100 --> 14:38.400
Let's put the range from negative one to one to get it centered around zero,

14:38.760 --> 14:42.480
and then scale the vector by a value.

14:43.360 --> 14:46.640
So now we have fine control over the strength of this effect.

14:47.140 --> 14:51.460
And here you can see this is basically what we had in the final setup to control

14:51.461 --> 14:53.680
some variation in how the stack is leaning.

14:54.180 --> 14:57.860
And if I change the random seed, it changes the overall shape.

14:58.820 --> 15:02.220
And again, this is quite different from what it would look like if we just rotated

15:02.221 --> 15:07.401
all the pizza boxes on their own, since they really have an effect on each other.

15:07.980 --> 15:12.200
So let's do the same thing to introduce a slight offset to the translation.

15:13.000 --> 15:20.841
I'll just add another add node, and then use yet another random value node.

15:21.500 --> 15:25.080
But we don't want any offset in the z direction, so let's set that to zero,

15:26.020 --> 15:30.100
and then we want it centered around zero, so let's put the minimum bounds to

15:30.101 --> 15:32.257
negative one, and then also add another scale

15:32.258 --> 15:35.421
node to control the strength of that effect.

15:37.180 --> 15:42.040
Now we can just very easily expose these as controllable parameters in the modifier

15:42.041 --> 15:46.420
by typing in input and creating a new group input.

15:47.680 --> 15:51.420
Just make sure to name them accordingly so you don't forget what they actually mean.

15:52.500 --> 15:54.980
Let's also expose the number of cartons.

15:55.340 --> 15:58.320
And there you go, that's a big chunk of the setup already done.

15:58.580 --> 16:02.726
We can dynamically control the amount and the random

16:02.727 --> 16:06.400
offset, giving us a very wild stack of pizza boxes.

16:07.860 --> 16:10.349
So next up, let's create the bounce effect that goes

16:10.350 --> 16:13.080
through the whole stack as the Vespers jittering.

16:13.620 --> 16:15.500
The idea for that is quite simple.

16:16.040 --> 16:18.841
This setup already has a control empty that

16:18.842 --> 16:21.360
bounces around with the movement of the vehicle.

16:21.640 --> 16:26.640
And then this is what we're going to use to move the bottom-most pizza box.

16:27.440 --> 16:30.720
We're basically going to just constrain it exactly to that.

16:30.721 --> 16:36.260
And then we're going to create a simulation to get the offset from that

16:36.261 --> 16:38.860
transformation and move it along through the stack.

16:39.280 --> 16:42.630
So there's going to be a little bit of delay to move all of

16:42.631 --> 16:46.080
the additional pizza boxes on top by that transformation.

16:46.820 --> 16:49.760
And each frame, it's going to move a little bit further through the stack.

16:49.960 --> 16:52.260
And that way, go all the way to the top.

16:52.920 --> 16:55.886
So let's start with that setup by making a bit

16:55.887 --> 16:58.840
more space and then adding in the simulation zone.

16:58.841 --> 17:03.300
To get familiar with how the simulation zone works in general, there is also

17:03.301 --> 17:06.620
another video on the Blender YouTube channel if you want to check that out.

17:07.120 --> 17:10.140
Here I'm not going to go into full detail explaining that.

17:10.840 --> 17:13.819
But essentially how it works is that we get some

17:13.820 --> 17:16.600
geometry in on the very first frame of the simulation.

17:17.180 --> 17:22.060
And then for each frame afterwards, there is a simulation loop happening

17:22.061 --> 17:24.920
between the output node and the input node.

17:25.440 --> 17:30.540
Where everything we pass out on one frame is passed back in on the next one.

17:31.580 --> 17:34.375
In this case, the data that we want to simulate

17:34.376 --> 17:37.360
over is going to be exactly a new matrix attribute.

17:38.220 --> 17:42.060
So with this simulation selected, let's go to the properties panel,

17:42.320 --> 17:46.260
and then in the node panel, add a new entry for simulation data.

17:47.180 --> 17:51.280
Let's call this the transform and then change the socket type to matrix.

17:51.960 --> 17:54.818
Here we also need to keep in mind that the geometry that we

17:54.819 --> 17:59.300
are working with is made up from instances and not meshes.

17:59.460 --> 18:03.180
So the attribute domain needs to be changed to instance as well.

18:04.300 --> 18:07.100
Let's make a very little test setup to see how this works.

18:07.620 --> 18:10.435
So let's add another set instance transform

18:10.436 --> 18:13.021
node and then connect that transform attribute.

18:13.460 --> 18:15.900
As well as a viewer node with control shift click.

18:16.360 --> 18:20.020
And right now it just resets all of the transforms to one.

18:20.240 --> 18:26.640
But if we connect this to complete the loop, and then also do a multiplication

18:27.860 --> 18:34.000
with another transform matrix, and then type in some value, we can see

18:34.001 --> 18:38.740
how now this actually changes the transformation of the cubes over time.

18:39.180 --> 18:44.840
So with each frame, this transformation is applied on top of the previous state.

18:45.320 --> 18:47.420
And that is what the simulation is doing.

18:48.240 --> 18:50.280
So this is working perfectly fine.

18:50.900 --> 18:52.820
Now let's get rid of these nodes.

18:53.920 --> 18:58.828
And I want to be able to control the very first pizza box

18:58.829 --> 19:02.660
in the stack with the controller empty from the vehicle.

19:04.100 --> 19:06.020
So let's add a object info node.

19:06.380 --> 19:08.680
And then I already have the empty in place.

19:08.880 --> 19:14.140
So now I can just use the eyedropper tool to select the wiggle control empty.

19:15.200 --> 19:18.780
Let's set the position to relative to get it into the right space.

19:18.781 --> 19:23.120
And now we can use the transform output to get it into the right place.

19:23.440 --> 19:27.540
But we only want that to happen for the very first pizza box in the stack.

19:28.440 --> 19:29.980
So let's use a switch node.

19:31.840 --> 19:38.640
And for the switch input, we can compare the index to zero, and check that only

19:38.641 --> 19:42.740
when the index is equal to zero, we want to set this transform.

19:43.360 --> 19:47.260
But now we actually need to apply this information to our stack.

19:47.261 --> 19:52.620
Right now we only stack up all the boxes at the very end with our randomization setup.

19:53.120 --> 19:57.780
So what I want to do is combine this with the simulation that we're doing.

19:58.260 --> 20:01.680
And we're going to do this very similarly to what we've done before.

20:02.180 --> 20:07.801
So let's combine the output from the simulation with another accumulate field node.

20:07.860 --> 20:10.480
Make sure to set the domain to instance.

20:12.900 --> 20:15.380
And then this just as well will accumulate

20:15.381 --> 20:17.940
all the transforms throughout the whole stack.

20:18.400 --> 20:22.860
And the transformations that we're going to get out of the simulation are just

20:22.861 --> 20:26.040
going to be the additional offset that we get from the bounds.

20:26.640 --> 20:31.140
So let's combine these two transformations with another multiply matrices node.

20:31.760 --> 20:36.020
Let's connect the offset in the first slot and then the stacking into the second.

20:36.740 --> 20:41.280
And you can see how the stack already snaps to the control of the empty.

20:41.920 --> 20:45.832
This is working because the very first pizza box is

20:45.833 --> 20:49.160
getting exactly that transform set from the simulation.

20:49.600 --> 20:53.085
And then the accumulate field node will give us this

20:53.086 --> 20:56.120
exact transform for all the boxes on top of it as well.

20:57.080 --> 21:02.800
The reason why we're using the leading output here while we were using the

21:02.801 --> 21:07.495
trailing output before is that now for the offset you want

21:07.496 --> 21:11.500
to include the transformation value for each box itself.

21:11.501 --> 21:16.640
So here the offset transformation for the bounds is used

21:16.641 --> 21:20.140
for the box itself plus all the previous ones combined.

21:20.700 --> 21:24.420
For the stacking itself we did not want to consider the

21:24.421 --> 21:27.540
height of the box itself but only the previous ones.

21:28.220 --> 21:32.199
So right now with this base setup the entire stack

21:32.200 --> 21:35.121
moves perfectly along with the control empty.

21:35.500 --> 21:37.120
But that's not actually what we want.

21:37.620 --> 21:42.520
Now that we have the bounds of the empty stored on the very first pizza box let's

21:42.521 --> 21:45.740
try and propagate that through the stack for each frame.

21:46.000 --> 21:51.860
So instead of storing nothing as the transformation for the other boxes we're

21:51.861 --> 21:57.160
going to take the information of the previous frame and then use an evaluated

21:57.161 --> 22:02.740
index node to plug that into the false input of the switch.

22:03.040 --> 22:05.660
Make sure to set the domain to instance.

22:06.360 --> 22:13.561
And then for the index input we're going to duplicate this index node and subtract one.

22:14.400 --> 22:17.764
And that will, with each frame pass through the

22:17.765 --> 22:21.300
transformation of the box below all the way through the stack.

22:22.180 --> 22:25.420
At this point we get a little bit of a problem where everything just disappears

22:26.140 --> 22:31.040
but as you take a close look this is happening over a couple of frames.

22:32.280 --> 22:33.840
And everything is just shrinking.

22:34.780 --> 22:38.480
The reason for that is that there's a difference in scale

22:38.481 --> 22:42.280
between the pizza box object and the controller empty.

22:42.720 --> 22:47.880
Here we don't really care about the scale we just want things to rotate and offset.

22:48.180 --> 22:51.864
So what we can do is do a separate and then a combine of the

22:51.865 --> 22:56.360
individual transform components and just leave out the scale.

22:58.060 --> 23:00.631
Now the pizza boxes are way too big but we can just

23:00.632 --> 23:03.241
manually scale them down to the size that we need.

23:03.900 --> 23:08.000
And if I play this you can see how now this is working perfectly fine.

23:08.180 --> 23:11.735
With each frame the bounce from the first box is

23:11.736 --> 23:15.081
propagated like a wave all the way through the stack.

23:16.660 --> 23:20.255
If I increase the size of the stack we need to go back

23:20.256 --> 23:23.100
to the very first frame to actually see the effect.

23:24.360 --> 23:27.260
But you can see how this effect is very clearly visible.

23:27.800 --> 23:30.795
To actually change the height of the stack in real

23:30.796 --> 23:33.640
time we need to change the setup a little bit.

23:33.641 --> 23:39.020
Instead of just passing in the geometry through the simulation input and then

23:39.021 --> 23:43.684
using that later on which will store the very first frame that

23:43.685 --> 23:47.120
the simulation is running we need to pass it in differently.

23:47.500 --> 23:55.060
So let's add a sample index node into the simulation set this to matrix and then

23:55.061 --> 24:02.280
instance and instead of directly using the matrix input from the simulation we are

24:02.281 --> 24:07.329
going to sample it exactly from the same index

24:07.330 --> 24:12.021
and then connect the outside of the simulation.

24:13.100 --> 24:19.020
This means that each frame we update the new stack with the changed height which

24:19.021 --> 24:22.332
can have a different amount of instances and then

24:22.333 --> 24:25.500
sample the simulated data from the previous frame.

24:26.720 --> 24:31.120
So now if I play back the simulation you can see how we can dynamically change the

24:31.121 --> 24:34.100
height of the stack and the simulation adapts to that.

24:34.340 --> 24:38.140
And those are the most important aspects of this demo setup done.

24:38.480 --> 24:42.600
There are a few additional things that I am doing in the demo file so if you are

24:42.601 --> 24:45.740
interested you can check those out but I hope this should give

24:45.741 --> 24:48.340
you a good kickstart to understand what you are looking at.

24:48.780 --> 24:50.770
And that covers most of what you need to know to

24:50.771 --> 24:53.900
get started using the matrix socket in Blender 4.2.

24:53.980 --> 24:57.540
Make sure to also check out the video about the new things in node tools to

24:57.541 --> 25:00.160
learn another application of using the matrix socket.
