[Music]
welcome back to part 2 of the two-part
Rubik's Cube tutorial from 9:00 between
and in this tutorial we'll be going over
how to add dynamics to the cube that we
created in part 1 so we'll be using a
few solvers and a pop network and what
we'll be doing is firstly giving our
cube dynamics and we'll be using a
rigidbody solver for that
I'll then be going over how to instance
confetti so we'll be using a pop network
and we'll shoot points off of the high
velocity areas of the cube we'll use
those points that are being instanced to
actually emit some confetti and that
will be passed into a bullet solver and
map will be dynamic we can then combine
the two effect and end up with a
completed rubik's cube hope you enjoy
Houdini we can continue from where we
left off dive back inside of our cube
geometry node and let's just make sure
we have the same settings in our solver
so I found that iteration of five and a
posterior Asian at four works quite well
for this effect so that's what I'll be
using so you may remember that from our
previous tutorial that we have this
input range and our output range and
that's when the cube stops solving
however the cubes start solving
immediately and it would be great to
have a bit of a pause before it starts
so to do that we can drop down a time
shift node like that in between our
solver and our time warp and we'll
change a few settings we'll go down to
this clamp and we'll say clamp to last
right click on the start or end frame
and say to leak channels and over here
we'll put a hundred twenty-four frames
now if you play this back this cube will
shuffle itself until one hundred and
twenty-four frames have passed so now we
can take this start or end frame yeah so
take our inference a copy parameter and
let's go until time warp and then our
input range will remove this and say
paste relative references so now we're
fetching the range from our time shift
so the end frame which is 1:24 and
plugging it into our input range and
what we'd like to do here is to save
plus 30 so we have this channel
reference plus 30 now when we play this
back you'll notice a pause of 30 frames
before the starts moving
so that's great we now have a pause of
30 frames and we can make use of that so
let's go down to our attribute promote
and before we actually begin on dynamics
is to set up one more thing so in this
attribute wrangle we'll just say at
speed equals length V hat V so to
explain what this is doing we're making
a new global attribute and we're giving
it a value of length of our velocity now
the length function takes each component
of a vector so the x y&z component puts
it to the power of each component adds
those three together and then finds the
square root
so it's the magnitude of a vector that
is being found and over here because
velocity is sometimes negative we've
been given a positive value that's
perfect because now we know how fast
each of these cubes are rotating so if
we bring up our parameter spreadsheet
and go over to s will find speed over
here so these parts that are moving now
have this speed attribute what we can do
now is we can drop down a group
expression plug this into the first
input of our group expression node will
change our group types of points rename
this to inlet underscore GRP one mission
group and let's type in our Flex
expression at speed greater than one we
don't put a semicolon here and now what
we'll notice is points that are moving
and are being grouped so we have this
group of points and have velocities on
them so the next thing we'll do is just
drop down Ino because we are now done
with the cube geometry will call this
cube underscore out
jump up and it's began creating a dot
network and this rename the stealth
Network cube underscore dynamics will
dive inside of this and drop a couple of
things
firstly we'll drop a rigid body solver
plug this rigid body solvent our output
and then we'll drop down and our beady
object plug this into the first input of
our rigidbody solver and then the last
few things will merge in a ground plane
so I bought inputs around and we'll move
this ground pin down on the y-axis - one
last thing we'll just drop a gravity
force over here and then you can bring
in our RB heat object so over here on
the soft part let's change this we'll go
over to our cube and find our cube
underscore out and accept will be using
deform and geometry and object transform
let's inherit velocity from point
velocity let's just rename our RPG
object to cube and we can play this back
and what you'll notice is this cube
isn't actually flipping it's just
bouncing around and the reason for that
is because these points are moving too
fast for our rigidbody solver to pick up
so what we need to do is we need to
increase the substeps
so push our sub steps up on our
rigidbody solver under the bullet at is
60 play this back
and now we have a cube that flips around
working dynamics we can go ahead and
jump up and let's create another
geometry node let's rename this node to
confetti we can hide our cube dynamics
top Network and our cube geometry that
inside of this confetti node and let's
drop down a dot import so the network
that we would like to fetch is our cube
dynamics node an object mask
we had it called cube now we need to
import it so the import style will
change the FET geometry from top Network
and there you go as your cube
but a lot of its dynamics next we can
drop down a tallit node plugs are top
importance our delete node and we'll
just change this entity type to points
and the group that will be deleting is
our omit group will delete everything
except our Emmet group
we have the parts that have velocity on
them the next thing we'll do is we'll
drop down an attribute angle and we'll
say if at CD equals equals any brackets
0 comma 0 comma 0 and do the following
and we'll just say remove point 0 comma
at PPL and what that will do is we'll
remove all of the black faces because
when we're emitting confetti we'd like
them to only have these colors and not
the edge colors so now that we have this
we can drop down our top network plug
this into the first input of your pop
net and it's dive inside of this pop
network so Anya the first thing that we
would like to do is reduce the life
expectancy of our points we will set
this to naught point 2 5 and on our
source we'll be using the scatter on two
surfaces so to control how many points
will be emitting we drop our constant
activation and constant birth rate to
zero I change our impulse count to 25 he
played us back you'll notice that we're
emitting these points and they may be
surviving for too long so we'll drop the
life expectancy to naught point naught 5
letters back
and there we go we have these points
that are being emitted so we can jump up
and next we'll drop down a copy two
points load
so into the second input or plug our
points and over here we'll start
creating some confetti geometry so drop
down a grid and we'll change it to a
three by six with two rows and two
columns will drop down a sub divide node
and then we'll drop down a poly extreme
so the distance will set to null point
one and will output a back face and then
copy this tail points
as you can see the massive at the moment
what we'll do is we'll drop down
attribute wrangle between our pop net
and our carpets points and in here we'll
just define a piece gap we'll say at P
scale equals North Point North three
like a decent-size so now we have these
points being emitted so the next thing
that we'll do is we will assemble them
and will say create PAC geometry will
transfer all attributes then we can go
ahead and drop down a you know
like you're sampling for now and this
will be our confetti underscore emitter
and before we jump up let's do one thing
and let's drop down another know take
out dot import and plug it into this
node will call this cube Collider alt
and then we can jump up and drop down
another dot network once again we can
hide all confetti rename this darknet
weapons here come to 30 dynamics dive
inside and let's drop a few things first
thing is a bullet solver and then an RVD
path object
we'll be using two solvers action so
we're going to be dropping a multiple
solver the way this works is we plug our
RBD packed object into the first input
out bullets all go into the second input
and we'll get back to this and add our
second solver into this shortly but this
just continue setting our senior so
we'll drop down at gravity force and
emerge yard let's imagine a ground clean
plug those into our merge node and swap
the inputs are out those ground plane
will drop its position by minus one drop
another merge node and we also want to
talk on Fetty to interact with our cube
so let's bring our cuban this will stay
static object plug that in tell merge
node go find the soft path and I would
be our cube Collider art now we have our
cube Collider over here we can just go
make sure that its collisions are
accurate was increase these uniformed
equations up to 50 there we go
you can hide this collision guide and
let's go to a soft path on our RBD
packed object and go find our confetti
out and I would be you know confetti
node under confetti in the top so we
could try playing this back
and nothing's happening now the reason
for that is because we don't actually
have anything for the first 30 frames
and this are biggy packed object isn't
continuously looking for things being
added to the salt pot so what we need to
do is we need to tell it that we have
geometry that's being added every frame
so let's drop down a stop solver plug
this into the second input over here
without bullets RBE solver that inside
of this and we'll bring in an object to
merge and we'll also bring in a merge
node firstly take your dot import so
this is the current geometry that's
within your network and plug into your
second input this object merge now this
object merge 4p fetching the confetti
geometry every single frame so we can
say confetti emitter such a display flag
on your merge node jump up and now when
we play this back remitting confetti
every frame
so you'll notice that our confetti is
actually getting stuck in midair and the
reason for that is inside of our
confetti geometry node so dive inside of
that and then dive inside of the pop net
and overhear our life expectancy we
actually to change this to know a boy
not one not brain or five actually keeps
all particles alive for too long so we
end up hitting them more than once per
frame so go back into your confetti
dynamics tab and the other thing that
we've got to do it on our static object
just use deforming geometry
a thing to do is just make our confetti
a bit lighter so to do that we'll fake
it by dropping our gravity falls to
minus five and we can play this back and
now we have confetti being shot about
and over here on this convex hull tab on
your IBD packed object and the bullet
data tab we have our collision padding
and our shrink collision geometry and
the one thing that you'll notice is that
particles or pieces of confetti that
land on the ground actually stick away
from the surface and the reason for that
is because our collision geometry is too
big so we can display our geometry and
you'll notice that it forms these boxes
around each of our pieces of confetti so
the way to fix that is actually just to
drop this collision parent in North
Point North node one and remove the
shrink collision geometry if we go back
to the start and play this again
you can now see our confetti has thinner
colliders
and so that's far more accurate you can
just hide our collider again play that
back
so now that we have that all working we
can bring this all together
so let's rename our RVD packed object
because we all need to be referencing it
we'll just call it
confetti jump out the level drop garnett
geometry node we'll call this one final
dive inside delete this file node and we
can drop down eight dot import node
we'll be calling in our confetti so
let's go tell confetti dynamics and use
that as the dope network and what will
be bringing in is just our confetti that
we just named we'll be fetching geometry
from the dot import and then we'll drop
down and object merge so this object
merge we'll be bringing in our cube
Collider out from our confetti tab you
just merge these two together and on
this dot import pulls they unpack and
what will we be unpacking well we need
our color attribute back onto this we
also need our velocity so we can say
transfer attribute
CD space V
and they yeah but now you're bringing
both of those in and you can just add a
ground plane a grid of some sort and set
up your lighting and cameras and you can
render this out everything has velocity
already but you don't need to add it
and of course you can cash this out so
it's not so slow you can cash out at any
point perhaps you want to cash out at
the end you to do that you can drop the
file cache note find a place where you'd
like to save it
I'll go to this D Drive Rubik's Cube
create a new folder
quality' toriel cache call this confetti
dot dollar FF or dollar dot eazy-e of
blood SE and the frames that we would
like to save we just like to save maybe
200 frames and then you can say save to
disk and after that you can load it from
disk there you have it that's how you
create this dancing confetti cube effect
so we've gone over this all solving
Rubik's Cube we've gone over the cube
dynamics time we've gone over the
confetti dynamics you have any questions
please comment down below and I'll get
back to them thanks for watching please
remember to subscribe and like our
Facebook page we have a lot of
interesting things coming up so stay
tuned for that
[Music]