PHYSICS For Absolute Beginners - SideFX Houdini Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys I'm wearing my magicians head is Houdini time welcome to another very very exciting tutorial in this tutorial I want to introduce you to working with physics in side effects routine side effects Houdini is a very powerful but also pretty complex procedural 3d software package that is gaining more and more traction in the visual effects industry now whilst physics in general can seem quite daunting working with physics in rapini can seem downright scary but we will take it nice and slow so this is going to be a mid-level beginner tutorial I will however assume that you have at least watched my absolute beginner tutorial on how to use side effects Houdini if you haven't yet panitch oh but now before anyone else gets hurt let's jump right into the tutorial welcome back to Houdini I've got a brand new project set up here and you won't need anything at all to follow along with this tutorial other than your own version of Houdini installed on your computer also note that while I'm using the in the edition of Houdini you will not have any problems at all following along with the free apprentice version before we get into the physics and for reasons are already covered in my last Houdini tutorial I'm first going to come up into the main toolbar and switch my desktop from built over to the technical desktop this is going to add a whole bunch of new UI elements but we are going to need them to really understand what is going on in our scene later on for now I'm simply going to come to the bottom here and I'm just going to collapse this additional toolbar just I see a little bit more of my viewport and let's get into it let's start out by creating a symbol box so we can simply come up into the shelf tool onto the create tab and hold down ctrl on your keyboard and click on box to create a box in the center of your scene there's our box let's zoom out a little bit and I'm going to drag this box up a little bit I'm also going to rotate it just a little bit so that when it - drop it drops a little bit more interestingly then come down to the main timeline control at the bottom of interface go over to the right hand side and enable this little clock switch here which enables real-time mode so your playback will be in real-time otherwise Houdini will just race through this as fast as I can make sure you at the very beginning and simply hit play and it's absolutely fascinating and not at all surprising that nothing at all is happening because all we have in our scene is a simple box if we go over into our scene view and again I'm just going to make this a little bit bigger all we have is this little box object here and if you dig into this geometry note all it contains is a simple box which we're seeing here and that is really all we have in our scene so there are no physics as of yet as is the case with absolutely anything in Houdini you could set your entire physics simulation up manually however for you know entry level users are highly recommended using the shelf tools at the top so on the top right-hand side you will find a tab for rigid bodies and in here you have a whole bunch of controls to create RBD rigid body dynamics objects and glued objects instancing ragdolls drains you can make things destructible there is a huge set of presets here that you can apply so let's come over all the way to the left side make sure you have your box object selected in your scene view and that's simply click on this little cute rubber ducky here which says RVD hero objects let's hit that and you may notice that our box has disappeared that is because we are already at position 79 on our timeline so the box had plenty of times simply fall down let's come down to the very left side and just rewind our entire scene and now if we play this back the box will fall obviously this still isn't a very much more exciting than what we had before but we actually have a physics simulation now happening in our Houdini scene if we go into the scene view you will now see that Houdini automatic added a new node called an auto doc Network doc stands for dynamic operations and this network is responsible for men and calculating the physics in your scene let's double click onto this auto top network and check out what's inside I'm going to again make this a little bit bigger otherwise this will be a little bit difficult to see press L to lay out all your notes and H to zoom in and this is our dynamics operator network at the very top we have our rubber duck and this is the RB d object this node essentially imports the geometry our cube and I will show you how that ties together in a second and creates an RB D object this object is then capable of interacting with the physics solver which is essentially the brain of the operation is essentially the tool that calculates how the physics is being applied to your objects now one thing you will notice that when you're using the Shelf tool Houdini does add a lot of default notes that and FCU's so for example the RVD object right now goes into a merge node where you can chain other objects into we don't actually need this merge node for now but I'm going to leave it it's essentially just a pass through at this point but the one important thing the most important part of this entire auto dock network right now is the rigidbody solver this is a solver for rigid body dynamics now whenever you hear the word solver and this took me a little while to understand it's actually really simple the sole purpose of a solver within Houdini is to calculate the state of something at the current frame based on the previous frame so it's essentially a sequential calculation and the purpose of the rigid body solver in specific is to calculate the state in the position and orientation of all of your physics objects within your scene for the current frame based on the previous frame you can see that our RBD object which is our box is set into the solver so the solver will now calculate the state of the box at frame number 1 based on the previous frame obviously there is no previous frame so it doesn't actually have to do anything but if I move forward if I now scrub forward a little bit you will see that the Box Falls and at frame 17 this solver will take the data from frame 16 and calculate this particular frame that's why when I jump for example 200 forty-four you can see nothing has been buffered here this solver will have to solve all of the frames between 17 and 144 so let's click here and see how everything is now blue it's because the physics solver actually had to calculate all of these frames because it can't calculate frame 144 without frame 123 it can't calculate frame 143 without 142 and so on and so forth the reason that is so important is because that is really essentially how any solver works and that is true for physics for fluids for cloth for fire they all use solvers that always calculate the current frame based on the previous frame so that's really the brain of this physics operation the output of that is essentially just physics data it's not actually the box itself it's just physical data that gets output that then again flows through a merge node where nothing else is feeding in yet so it's just a pass through it then flows through this gravity node which what a surprise calculates the gravity on top of the physics and it then feeds into this output node here at the bottom you may wonder that well if this is just a physics object so this doesn't actually represent the box and my output is just physics data how does the box actually move how does Houdini know to move this geometry node based on the physics data that is tracing through this network this actually took me well to understand and the easiest way to explain this is to look at our hero object at the box object that we're importing if I bring up the properties it has a sub path a surface operator path which points to some geometry that gets imported into this network and turned into an rbv object this path very much like a file system path points to /o bj / box object 1 slash dot import 1 and as I've covered in my previous tutorial and this is a path that refers to a node within your Houdini network in the technical desktop and again that's why I love it on the left side we have a tree view and in here we can now find this elements so I can find root object box object 1 dot import 1 and if I select this and let's press L + H to make sure we can see everything that is inside this box object 1 and you will notice that well we have the box in this node before but now Houdini has actually added a rest note and a dot import note the rest note is not that important in our scene it actually just helps kind of make the material stick to the bodies as they move and transform and so just calculate a rest position in a third property to this data but then there is this dot import node this node is responsible for interchanging physics data with our auto dock network the inputs into this node is what's being fed into the audit of network the order that network then will process the data and at the output of the order dot network that data flows back into this node and this node then does something to the geometry within this scene and what it does down here at the bottom there's an import style so that refers to the way the data from the auto dock network flows back into this particular box object one with transforming the input geometry so this node actually takes the output of our order dot network and it applies it to our box object so that's why when we play through our scene the box false if I go back to the beginning and if i bypass this dot import node and if I now play back machine my box will no longer move because I'm no longer exchanging data with the job network so the data is no longer flowing into the network and to calculate this physics position and data for this box no longer comes back on to the geometry let's disable the bypass again rewind and let's play this back one more time and again the box will fall now let's spice up our scene just a little bit adding a ground plane let's come back to the object level and you can create a grid itself and turn that into a static RBD object what I prefer to do is I can come up into my shelf tools and over on the right hand side you will find a collisions tab and in here you will find a ground plane object that you can just create by holding ctrl and clicking on it so now we've created a ground plane and here's our ground plane object in our scene view and now if you jump back into this auto Network its governor whole lot Messier again let me make this a bit bigger l and H so you can see what's going on and on the right hand side you will remember our rubber duck the rigidbody solver and the gravity node on the left side we now have this ground plane object and again this is just a Houdini node that represents the ground plane in our world as a physics object so it can interact with the physics in our scene again goes through a merge node we can ignore that and it then goes into this static solver again remember a so that's just something that calculates the state of the current frame based on the previous frame the purpose of the static solver quite honestly is to do nothing at all it doesn't actually modify or calculate anything it's just used as a pass-through but it becomes useful when you're trying to blend or switch between different solvers and then what happens is that this ground plane gets merged with the output of the rigidbody selva so this actually merges the physics data between our moving object and at the ground plane which is absolutely static then obviously we still apply gravity and then output the whole thing so now if you rewind our scene and play this back the Box falls onto the ground these networks are really the fundamental way in which Houdini applies physics and there's a lot more to it that I haven't even touched yet obviously but I hope you do start to get a feel for how Houdini deals with physics especially this hold up import and export thing that happens to apply the actual transformation onto the note which is what essentially makes the Box drop in the end so these networks really just generate position and transformation data that you then have to backwards the fly back onto your geometry to make things actually move obviously by using the shelf tools a lot of that planning will be set up for you automatically but there's nothing stopping you from just doing it all manually if you're so inclined now if you check out our scene one more time this is not terribly exciting so one thing you might want to do for example is give your objects a little bit of initial velocity so they don't just you know drop like a dead body onto the ground if you want to do that you actually have to do that inside the auto doc Network where you're importing your geometry and turning them into an RPG object so let's select our RDB box object once our hero object note let's bring that up and this note is just an RB D object note there's a huge amount of settings here that you can adjust and I won't go through them all obviously with Houdini you can always come up to the top right hand side and click on this little help I can I'll bring up the Houdini help which will explain what there's no does and what all of these settings do the main ones I'm interested in now is well obviously soft path we already explained this so this is the dot import note where the data comes from and where the data goes back to and at the bottom you will find the tab for initial State this is where you can define the initial state of this RBD object that represents the extra cube in our scene you can move its position or rotation the two things I'm more interested in is you can give it a velocity or an angular velocity so for example right now our cube simply drops to the ground but what I can do you can see the axis here Z Y and X so let's give it a bit of a push in the X direction so it's going to fly off to the right-hand side let's simply come into our our BD object within the auto Network go into the initial state tap and then we'll give it an initial velocity of six again make sure you at the very beginning and let's play this back and you can see the box is now being tossed over to the right-hand side we can also give it some angular velocities so for example let's give it a velocity of 50 in the Y direction again let's rewind and play this back by the way in order to play back and stop your timeline in Houdini simply use the up arrow so up arrow to play and you can see the box is rotating a little bit let's stop this again rewind and let's give it a little bit more maybe we'll make this 120 and let's say this back and you can see the tube spins as it flies away so this initial state gives you a way to define how your objects are going to move from its starting point let me scoot this over a little bit so we can see our scene just oh the better the other properties you like you want to modify for your physics simulations is obviously how these objects interact so right now the cube has a very clear way of dropping onto this ground but there are certain physical properties like friction bounds that do govern how this interaction happens and how this movement looks in order to adjust those ones make sure you still have your RBD object selected in your scene view within the auto top Network and in the settings under physical at the very bottom you will find a whole lot of physics properties that you can change you can change the mass you can change rotational stiffness the balance or the friction temperature a whole bunch of other settings that will affect how you simulation plays out so for example let's reduce the friction to 0 which means the cube is going to be treated as if it was ice so it's going to have a very very low friction it will rotate the camera a little bit because I do expect this cube to scoot along the ground for a fair bit let's play this back and there can you see it sliding it's essentially like the cube is being treated like ice whereas if I remind and check the friction up to maybe 5 so it's like a really rough surface that's going to stick quite quickly and now play this back you can see the cue party spins it hardly moves it just kind of stops where it lands now that we cover some of the basics of how to work with physics in Houdini let's have some fun let's come back up to our object level I'm going to rearrange a few of these panels let's zoom back in and I'm actually going to delete my box object I just want to leave the ground plane let me scoot this over a little bit again and kind of Center our scene also don't need to see quite as much of the tree view and let's create a huge amount of spheres that just drops out of the sky and lands on the ground before we do that though however I do want to make one quick note you may have noticed that I just deleted the box from my scene view however if you go into your auto dock Network you can see that the import for my box object is still there my merge of my rigidbody solver a store here and I can still see the cube that is weird what's what's going on so there's still earth now it's gone I'm confusing Houdini because I've actually deleted a geometry note but I haven't actually removed the rigidbody part out of my auto dock Network a much cleaner way of doing this rather than deleting your geometry notes let's come back to the object level and let's undo to get our cube back and there it is and now instead of deleting this box object because it is part of the physics emulation what I actually want to do is I want to come up over on my right and five image shelf - there'll be a drive simulations tap and in here you will find a button to remove object from simulation and so make sure that your box object is selected and rather than just hitting delete to use remove objects from simulation so let's click that this is now highlighted the RBD object node in our auto dock network that we want to remove now either press Enter or click the button one more time and there you go so we've now removed this box object from the simulation it's kind of trimmed down the tree of our auto job Network the ground plane is still there that's still valid because it's still part of our physics simulation let's return to the object level and now we can delete our box and everything is nice and clean but now enough dabbling around let's get to the fun part now in vdd there's always a million ways to do the same thing so you will have to bear with me through my newbie way of approaching this but what I'm going to do is I'm going to come into my scene view simply right-click and let's search for the geometry node and place down a geometry node because what I want to do I want to create a large number of spheres floating in mid-air that will then all be affected by physics and scatter onto the ground let's double click onto the geometry node to jump into it and I'm going to delete the default file node and let's create a simple sphere now I am going to move the sphere quite high up and maybe zoom out a little bit and I'm going to use this sphere to essentially distribute a whole bunch of other spheres up in the air so let's increase the radius of the sphere to ten by three by ten so it kind of have a little bit like a giant Smarties hovering over the ground next let's click on to the output connection so we have an output actively connected let's hit tab to bring up the node menu and let's search for the scatter node let's select scatter and drop that down and if you realize that the scatter node will distribute points along the surface of the object so now have a whole bunch of different points floating in mid-air which is kind of cool now let's create another sphere and what we're going to do is we're going to essentially use another sphere or you can use any other object and copy that onto all the points that we creators so let's just hit tab to create a new note and again let's lay down a sphere so here's our other sphere I'm actually going to leave it at the default position this is quickly visualize it and that makes you might change the radius to point to point to point to so it's a little bit smaller and in order to copy this sphere onto all of these points we're going to use a copy to point notes let's hit tab and search for the copy two points note let's place this in our network and this note takes two inputs on the left side if you have over this it's the primitives to copy and the one we want to copy is the sphere so I'm going to grab the output of the sphere and feed that into the left input of the copy two points note and on the right side if you have over this it'll say target points to copy to and I'm going to take the output of the scatter note which all these points are floating in mid-air and connect that to the right side of my copy two points note and now if I visualize that and zoom in you can see that I now have this fear copied to all of the points that I've created to me it does look a little bit too uniform though at the moment so I'm going to move my scatter note over to the right side click onto the connection between the scatter and the copy two points and let's search for a point jitter note let's place that down at the point two that does exactly that account jiggles these points around you can kind of define how big you want these to kind of spread out so still they distribute a little bit more randomly that looks pretty cool and finally just for neatness sake and because I'm a bit of neat freak let's connect a null to the copy to point out put and I'm going to call this one spheres out and let's set the visible flag onto that let's come back to our object level and unselect everything so here's our scene right now and now if we play this back again nothing had always happened because right now our spheres aren't connected in any way to this auto top Network just like we did before let's select the Geo one node I'm actually going to rename this two steers and let's come up into the rigidbody shelf tools and let's click on our BD objects and this shelf to automatically deal with the fact that we actually created lots and lots of pieces of geometry to look a little bit different but let's simply select the spheres node with all of our spheres and hit our BB objects let's unselect everything and now if you play this back all of our spheres will fall and scatter on the ground if we jump into the auto top Network for seconds and again press L and H to lay this out over on the right-hand side you will find a new note this one is now not a cute little rubber duck it's actually an RB deep act object which represents our spheres but the principle is exactly the same this essentially imports everything from this sub path that we have down here from this geometry path which is OB j /c s slash adopt import 1 into this network then applies all of the physics and that then exchanges back and applies the back onto the spheres so if you return to object and dig into the spheres note again you will see that from our spheres out null objects we have a rest position which we had before as well again just deal with material sticking to the surface of the spheres we then if this assemble node which kind of deals with the packed chromatids and again that's kind of a topic for another tutorial it's getting a little bit complicated but then in the NP again just have this dot import which exchanges data with the order dot network and then applies all of those transformations to all of the individual fears let's one more time just rewind and play this back and it looks pretty cool but you know it's just a little bit boring all of this feels kind of drop exactly the same way just it looks a little bit too uniform now you may think well I can just come up with into my objects dig into my auto top Network and on my spheres node I can kind of come down into my initial state and they will give them some velocity again in the x-direction maybe we'll give them a 10 this time and pretty sure that will do something so let's again rewind and play hmm yeah well it gave initial velocity but it keeps all the exact same initial velocity which that just looks really really hot so let's not do that so this is going to be the last thing I'm going to show you I'm going to show you how to essentially apply different velocities or random velocities to all of these objects that we've created in our geometry note you have noticed that in this RBD packed object same as with our rubber duck hero object you've had an option at the bottom to say inherit velocity from point velocity this actually allows you to define a velocity attribute as they're called in Houdini and have different ones on all of these points for all of these spheres and then the physics simulation will pick the velocity from that defined velocity as opposed to applying the same velocity across all spheres each of them can have their own little velocity which you define via an attribute so first off let's make sure we enable inherit velocity from point velocity which will disable the velocity and angular velocity settings in here if we play this back nothing has changed yet because all of our points don't yet have a velocity in order to do that let's come back into the objects level and dig into our spheres and now it's going to get a slightly bit more technical and again there's much more to be explained in further tutorials but just follow along it'll end up looking pretty cool so in our network we start out with a simple sphere we then apply a scatter to it to generate a number of points and we then do a point to try to kind of juggle them around a little bit so that bit more randomly distributed now in Houdini they exist this concept of attributes and you can have random attributes on points on primitives on detail or classes there's a it's quite an involved concept but the easiest way to see the actual use on your points is to come to the bottom of the technical viewport and kind of pop this open and this is going to give you the geometry spreadsheet the geometry spreadsheet will show you all of the objects in your scene as well as their current properties so let's make sure right now I still have this doc import node selected make sure we actually select the point jitter and what we'll see in our geometry spreadsheet is we have a number of points and these points only have a single property called p4 position so if I scrub through its 1000 points and all they have is a position now in our altered op network we can adopt a velocity from the velocity attribute but right now these points has no velocity attribute we need to create that first in order to do that let's move the point jitter over and let's click on the connection between the pancetta and the copy tuple and hits tap and let's type attribute attributes actually one of the core concepts within Houdini that really gives the tool its power they essentially allow you to define any property on anything you want and then to use that data to drive anything else be that texture color transformation fires smoke fluid anything at all so athletes are hugely powerful which is why you have so many notes to work with them for example there is an attribute create and we could use this node to create a velocity however that would create the same velocity for every point so the one we really want is an attribute randomize which will both create and then randomize the attributes let's select attribute randomize let's drop that down and you will see that all of our points have suddenly gotten really really colorful the cool thing is that these attributes will actually carry through so if I now visualize my copy two points all of my seers have gained that come up which comes from the point attribute so this is actually really cool and in the geometry spreadsheet you will see that all of the points we have in our scene now has this CD actually to adjust the color however we don't really want the color although you can certainly leave it and just make another one of these attribute rendom eyes notes but let's select the EXPEED randomize bring up the properties and the attribute i want to create is called V V for velocity and let's hit enter and you will note that immediately in our geometry spreadsheet color disappeared or the spheres went back to gray and we now have this V this velocity vector defined with our attribute randomize node still selected let's come down to the bottom and let's change the min and Max range of this random attribute from -5 across the board to 5 max so now the velocity is randomized for each point between -5 and 5 so this is kind of our data that we're working with now and the very last thing we need to do and this just has to do with the fact that we're using a packed primitive here we need to come into this assemble node so let's select the assemble node and down at the bottom we need to make sure that we transfer a certain attribute because right now our PAC prims are kind of using this velocity in our rest you will still see the velocity attribute for all of our points so these are all of the points remember so they've got a position they have a rest property after they've passed through this rest note and they still have the velocity now if we go into the tack prints all they have the position and the names of velocity gap loss along the way so in this assemble note make sure that under transfer attributes you add V into the list so that the velocity gets taxed as well otherwise your physics simulation will not have access to this property and it won't be able to use it so now let's come back into our object level make sure you at the beginning let's zoom out just a little bit and let's collapse the geometry stretches so we can see what's going on and let's hit up to playback the final scene and nothing happens and this again if you're new to Dini gets me every time let's come back into our spheres what has happened is that right now we're visualizing the exporting the copy two points out of this geometry notes we're not actually applying the dot import data to a sphere so let's come down to the bottom and make sure we're visualizing this dot import node otherwise the physics data just won't be applied then nothing will transform and everything would speed static so now let's return to our object level and select everything and let's play it back cool that looks much more exciting so now what we have is we have a bunch of series all defined by points we could color them in and make them different sizes or give them different other properties and they all can't just explode in midair and then rain down to the ground I hope this gave you a gentle introduction on how to work with physics in Houdini and at least gets you comfortable enough to start playing around with some of these shelf tools and some of the other stuff that you can do with in Houdini obviously there's still a huge amount of information to cover and we haven't even gotten to the really fun stuff which is breaking things but hopefully you did enjoy what you learned here today and I'll try to get around to moodini tutorial soon and that's all there is to it I really hope you enjoyed this tutorial if you did I would greatly appreciate it if you could give it a thumbs up favourite it and share it with the world if you do want to see someone who's been making invisible so Charles just like this one engine you hear please consider subscribing and as always if you do have any comments questions or suggestions just leave them down in the section below thank you very much for watching and until next time I will see you later [Music]
Info
Channel: Surfaced Studio
Views: 62,353
Rating: 4.9557366 out of 5
Keywords: SideFX Houdini, Tutorial, Physics, Beginner, Introduction, Absolute Beginner, Newbie, Start, Overview, How to Use Houdini, Houdini, Rigid Body Dynamics, Destruction, Free 3D Software, 3D, Animation, Procedural, Cameras, Lights, Rendering, Mantra, Interface, Help, Start Learning Houdini, Surfaced Studio, Easy, Entry Level, Free, Simulation
Id: VaMuKbvjzsU
Channel Id: undefined
Length: 31min 41sec (1901 seconds)
Published: Sun Jul 02 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.