Blender 2.8: Simulating RigidBody Physics! #b3d

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello my name is Colin and this 1 or 2 points toriel we'll be talking about blender 2.8 integrated rigid body physics engine blender has a physics engine built in that means without much effort on your part you can simulate objects in real space with gravity so that objects can fall objects can therefore bump into one another push each other over knock each other over objects can act in a realistic fashion like they would if they were solid objects without you having to do much work at all except to set the scene up without having to do any animation at all you can get a great looking scene in fact in this video in the last part of this video we're gonna create this simple scene of a wrecking ball on a chain and it's gonna knock over a whole stack of Jenga like a blocks all stacked up and it'll actually be quite easy to set up and once you create it you can have it as a blender scene 3d file and you could render it out to a movie file if you like speaking of which if you've not checked out the latest videos in this blender two-point tutorial series on my channel in this series I'm teaching you from the ground up from the beginner level how to use blender in order to create 3d models three animations short animated movie productions on your own of course if you like this video if we're done something please go ahead and click on that like button below this video it really helps out me and my channel and if you wanna see more videos like this one in blender 2.8 or in the cadeau game engine click on that subscribe button as well and click on the bell icon to be notified whenever I upload a new tutorial so physics simulation in blender 2.8 starts with a scene just like normal you get a cube mesh object a camera and a light we're gonna simulate not this cube object I'll select it and press X to delete it on my keyboard and I'll click on delete I'm gonna go up to add and I'm gonna add a new mesh object let's use a monkey head because monkey heads are cool and they're better looking and they have more geometry more faces and edges to work with which will make the simulation of the object bumping other things more interesting in order to set up a rigidbody simulation or rigidbody world you have to enable physics on an object by object level so if I select this object and I press play on my timeline well nothing happens it's just a mesh just like normal but if I pause and go back to the beginning this is important you'll get into the habit of using this back to frame one button a lot in this video if I select a mesh object I can go up to the object menu and then I'll select under rigidbody I'm gonna make this object be added to my physics simulation as an active object an active object will fall with gravity and it can bump into other objects any kind of an object in fact you can get pushed around it can stop when I hit something that's heavier or a passive object we'll talk about that in a minute but an active object is basically on your world object if I select that well this object is now part of my rigid body physics simulation and if I go back to frame 1 and I press play it will fall in fact it'll keep falling if I scroll down there it is and you'll notice that there are no keyframes on my timeline like recording or showing me how that movement works but there is this orange bar this orange bar is there whenever you have an object that's a rigid body object selected in your scene the monkey head is selected this is called the cache the memory cache means memory of your simulation this cache is part of your blender file and it represents where or stores where that object is and its rotation and scale and everything on a frame in fact even more than frame by frame in that scene from frame 1 to 250 which is your default timeline length if I pause I can then drag the top of my playhead around and I can look at any frame in my simulation the thing that kind of trips new blender users or new users to blender 2.8 especially up is that if you are somewhere looking at your object in your on some random frame if you try moving your object I'm just going to keep my selection tool but I'm going to use keyboard shortcut key she is grabbed if I tap G and then move the object and then click well normally it would stay where I click but if you're in the middle of your cache that calf will go hey no I'm not gonna let you move that object because I know that it's supposed to be where I have simulated it to be which is well it's in the middle of falling the problem is is that it actually did move that object and in front of Trapani this is something that I hope they fix or solve or let you know what's going on because if you then go back to frame 1 look what happens it kind of erased the simulation and it actually put it there so you won't actually see your movement until you go back to frame 1 or frame 0 which means that you should go back to frame 1 or frame 0 before you make any changes of any objects in your simulation ok get into the habit of that that will lessen the frustration of editing or moving things in your simulation and it'll get you in the habit of knowing that you have to reseal 8 once you change anything ok so if I don't want there I can press alt G alt G will do the same as clear the location alt G does that it'll put it back where it was and then I'm not because I'm on frame 1 or frame 0 I can then move or use the G key to move that object up and I could then press play to re simulate okay but I don't want the monkey head to fall I want to and keep going I want to hit the ground so I'm gonna add a mesh plane and a plane object is just a mesh that has one surface but for sides it's basically two triangular sub polygons essentially in my words if I tap s I can make this bigger by moving my mouse of course and I can click and if I press play from frame 1 it should sing late but that crown'd is not yet part of my rigidbody world every object needs to be added so I'm gonna go back to the beginning again get in the habit of using that button and I'm gonna select my ground go up to object and I'm going to go to rigidbody and say add passive this time passive objects are physics objects they are part of your simulation but passive objects do not fall and they cannot be pushed or influenced by other objects they're kind of rock solid objects like the earth they can't move they're glued down so this is now a passive rigidbody object I'll go back to frame 1 make sure I'm there press play and now the monkey head will fall it'll hit that object and it'll react and basically land on the ground and as you can see it looks pretty good if I kind of scrub through where I have that cash on me on the monkey head or in my whole scene you can see it lands it tips over just like it normally would and it comes to a stop eventually it's kind of doing a little bit of rocking back and forth great are we done is that it well no there's actually a lot of things you need to know at least a fair amount of things you need to know in order to keep going with physics beyond this basic knowledge this way going to the object menu and selecting objects and changing them into active objects and passive objects from rigidbody isn't the best way of going about things generally you want to have more control and that more control is over here in your properties editor this editor has lots of tabs at the side of course one of the tabs that we haven't explored yet in this two point in tutorial series is the physics tab it looks like a little I'm actually not sure when it's supposed to be even supposed to be like an earth with a moon going around it or an atom with a nucleus and an electron going around it or the Sun and the earth I don't know it's one of those things maybe something else but that's what looks like to me if you select it and you select a mesh there will be a bunch of options for you here I'll make this a little bit bigger and if you haven't yet added it as an active or passive object you'll see basically this nothing except for these buttons this is where you can enable different types of physics rigidbody it's just one of the types if you click rigidbody that's the same as going up to object rigidbody ok and doing it as I did before again I should go back to frame 1 before I do anything like this ok you can change the type here once you select rigidbody from active to passive or whatever you like you can also change the mass so you can make something act like a heavier object keep in mind that this scene right now is gigantic every one of these squares in my crate floor is one meter by one meter by default that's really huge this is a gigantic very light as a balloon monkey head so what turn this up to let's say you know let's say ten kilograms and press ENTER and if I reseal it it will act a little bit different it'll feel a little bit more heavy or at least act like that in my scene okay there are a lot more settings though right now this monkey head is not actually bumping into other things using the shape of its own mesh it's using what's called a convex hull a convex hull is basically a low poly shrink wrap around your mash so it's not using every single vertice an edge it's a low poly version that you can't see and that just helps speed things up you'll notice that when you simulate if I go back to beginning and press play if you were to simulate that's actually just move something a little bit so that it has to reseal eight that you were playing back at a certain frames per second and it should be playing back at twenty-four by default if it's going slower than that for you it's because you've got a lot of things in your scene and it sounds like having to calculate things out but the fact that this monkey head is a convex hull is helping it out because the convex hull is lower polygon if you want to use or sing let your objects in a simpler way you could let's say change the collision shape to a box and therefore it'll just use a six-sided collision bounds and if you simulate from the beginning on frame one with a box shape it'll act just like a box and it'll land just like that in fact you could do this a lot you could have a lot more monkey heads and it wouldn't slow down as much I'll duplicate this 150 and I'll tap Z on my keyboard to move it up and down on the z axis and I'll move it up and click maybe I'll move it over a little bit and if I see you late they will land on each other flat so they will act like they are just boxes you don't actually see the boxes when you render out a frame or a animation but that's how they interact with one another okay if you go back to beginning on frame one and you change them both their collision shape to let's say a sphere then they will act like Spears they will roll around be careful though at least you spheres are intersecting they're overlapping so I might want to move I'm apart and let's see I take my ground and I rotate it pardon my maybe I'll change the size the text size of the ocean to 24 or something to make that smaller so it's not quite so in the way good okay if I rotate the ground that's just my screencast keys add on so you can see what he's I'm pressing if I rotate the ground and now simulate and there's fears well they will roll down okay hey not too bad pretty easy pretty effective looks realistic I'm gonna undo that rotation on frame one and I'm gonna get rid of this second monkey head if I want the objects to interact when they touch a little bit differently in other words maybe I want the monkey head ball a sphere to bounce well there are more settings under the physics tab for each object one of the categories is called surface response if I open that up you get two settings friction and bounciness will leave friction for a minute or two from now but if I play with bounciness it goes from zero to one if I turn it up to let's say 0.9 and I press Enter well if I go back to frame 1 and I simulate it doesn't quite act as you'd expected it's not exactly like a bouncy ball yet that's because both objects that are colliding need to have at least some bounciness and that's a little bit weird I know but I'll turn the floors valentinus up to 0.9 as well and I'll go back the beginning and I'll simulate and now it it bounces the way you might expect sometimes it still acts a little bit weird though I find you might just keep bouncing especially if you turn them all the way up to one for both objects I wouldn't do that that's why I chose 0.9 okay again sometimes things just act a little bit weird and not as you expect in the simulation engine I'm going to turn bouncing this down on both objects to illustrate this and I'm gonna add another object I'm gonna add a cube and I'm gonna make the cube of a bit bigger and I got to have s and then Z to squash it down it's like a flat kind of platform and I'm gonna move it up a little bit if you double tap are the are rotate key if you tap it twice you can then rotate it around kind of freeform I'm just doing this like an rotate a little bit off-kilter and I'm gonna add it to the rigidbody scene now I'm gonna make it an active object but I'm gonna make it be a box or have a box collision shape okay so it'll simulate more easily this box is pretty big but it's only one kilogram and it's gonna land on the floor now because it's an active object the monkey head is 10 kilograms I'm gonna turn that up to about 40 kilograms which is quite heavy and I'm gonna simulate from frame 1 or frame 0 and let's see what happens aha good you did what I want which is actually not very good it pushed because the monkey head ball is heavy it actually pushed that light box right through the floor now there's a few ways you could deal with this and by the way the floor just kept falling once it it went through the floor now there's a few ways you can deal with this the first way is you can make your ground into a box in other words you can make your ground thicker and therefore maybe if the box that was on top went into it you would get pushed back out of it upwards and not down where it's okay because it actually would have volume or perceived volume in that solid object the other way we can fix this is under a different tab in the properties window we can go to the scene tab and the scene tab has a section called rigidbody world scene tab looks like a cone object and a sphere object and I think I supposed to be a little light it's the settings for your whole scene it has a rigidbody world section and if you don't want any simulation or you want to turn it off you can check this checkbox that will disable any physics immolation in your scene but this is worth settings for your whole world is in terms of physics simulation one of the settings is called steps per second and it's set to 60 by default this setting is how often or how rapidly blender calculates where the object should be in a rigidbody scene so it doesn't use the 24 frames per second to figure out where the object should move to and in the next frame it uses kind of in-between a smaller increment which is good it'll be more accurate the higher number this is theoretically if I want my seam to be more accurate I can turn this up higher I like doubling it or tripling it to 120 or 180 let's try 120 and I'll go back to frame 1 if I now play this same exact scene with the same locations at the beginning let's see aha it works it works a lot better do I have bounciness turned up under my physics tab on anything still no it just was a little bit bossy sometimes things don't act quite like they should maybe you could try turning under that scene cap again the steps per second maybe a hundred and eighty might work better maybe 300 or 500 and work better for you it all depends on blenders mood at the time really or what's in your scene or how it's moving are the locations or their settings it's all variable you can try what you like sometimes things actually work better with 60 but a higher number okay so that steps per second while we're here let's talk about the cache settings right now this cache is orange it's filled up assimilated this scene but even if my timeline if I change it to be a longer timeline like 505 0-0 frames and I press Enter so I could actually keep playing past 250 it would not let me simulate a longer simulation even if I wanted my animation to be longer if I press play well it'll you know the ball will will kind of keep rolling and then it'll just stop and it won't even let me see make more that's because of my cache settings the cache is only set to go from 1 to 250 if I expand this section out again this is under my scene tab you can see my cache start and end values I actually cannot I couldn't change it so I'm not seeing lighting away from the beginning if I don't want to if I want missing Latian to start after a little while I can change that but I can also make it go longer so if I want 500 I can type that in or drag in this little value box and make it whatever I want okay now if I go back and press play it will keep simulating and the ball will fall off and because the ball is heavy it'll push it the light box and it'll keep going it'll probably fall off if I let it go far enough okay so that's your cache simulation start and end if you want a longer simulation than the default 250 okay let's go ahead and make a little bit of fun scene now and let's talk about animated objects interacting with simulated objects I'm gonna delete both of these objects I'll select them both and press delete and I will add I'll press shift a to bring up my add menu I'm gonna add a mesh cube this is gonna be a dominant we're gonna make a line up of dominoes that are gonna fall over and we're gonna make an animated object like a little finger object that pushes all the dominoes over so this Domino needs to be a bit different shaped I'm gonna move it up I'm going to tap and in fact I only use my scale tool I'm gonna make it a little bit thinner on the red x-axis and I'll make it a bit taller on the blue z-axis so roughly the shape and I want to be a physics object it's just a default mesh right now so I'll go to the physics little earth-moon tab and I'll make it a rigidbody just go back to frame 1 otherwise it'll act kind of weird and it's gonna be lighter than this maybe 0.5 kilograms all right this is really big so we're not really doing very well on our simulation front here and or at least our accuracy in terms of scale front here this needs to be an active object it is it needs to be simpler so we can simulate tons of dominoes if we want so I'm not gonna use a convex hull I'm gonna use a box shape okay that will simulate very easily because a box only has six sides and twelve edges and eight vertices is it's very easy for it to simulate and I'm gonna duplicate it so I'm going to I'll keep my move tool up actually I'm gonna move it over straight about there maybe I'll start it a little bit above the ground so it has to fall a little bit if I play it right now it'll kind of land and wiggle a little bit and from frame zero if i duplicate 50 and I tap X shift keys duplicate and then if you tap X it'll only let you move the copy on the x-axis so be like that in fact I'm gonna go and press the little green dot right there to go to my front view exactly so it's straight on so I can see what I'm doing okay so I'm gonna select both and I'll duplicate both now to make it faster shift D and then X and move it over you know for a little bit more I'll grab all four with the shift key and shift D and X and I like that I like having 8 and I'll make the ground a little bit bigger with the s key ok if I go back to frame 1 or 0 and I press play it'll simulate in order to make them fall over though I could just from frame 1 go to my front view and that's the one key on your number pad by the way or you can press the little green dot not the one with the y on it to go your front view if I tap are I can rotate this one and therefore it'll fall over if I rotate it enough and if I simulate of course it'll knock all the other ones over and I've got a pretty cool little scene you'll notice though that things were sliding around a whole lot and this is where friction comes in and I want to show you how to copy a setting that you change for an object from one object like friction and I want you to be able to update all your objects at once to have that new updated friction setting so I'm gonna go back to frame 0 and I'm going to select all of my Domino's here now you'll know as I select more and more with the shift key held down the last one that I select is this lighter orange color and all the previous elected ones are still selected but they're darker orange that's because the last the most recent when you select is your active object and that's what you see the settings of over here so this one is now the active object they're all selected if I change the friction I'm actually gonna be only changing the friction of the active one the most recently selected one so I'll type in you'll be able to drag this to some random number like 0.6 85 if I were to select just this one it would show me is 0.5 because I haven't changed this one or any of the other ones just this one in order to copy the settings from the active physics object over to the other ones you can go up to the object menu and go down to rigidbody and say and select copy from active and that will let you change your settings really quickly from one object I copied over to the other one so or all the other ones that are selected as well so object rigidbody copy from active click and so now this one is a 0.85 friction this one is also now they're all now six zero point six eight five okay I'm gonna change the friction of my floral turn up as well and from frame 1 I'll press play and now the dominoes aren't sliding around so much so they they catch each other more and fall over a little bit nicer okay let's go ahead and add an animated object but influences our scene and show you how to do that so I'm gonna go back to frame 1 or frame 0 I'm gonna get rid of Roxy I will alt are alt R or object clear rotation will clear the rotation of that object because I wanted to stand straight up but I'm gonna add a sphere and we're gonna make it into like a finger shape really quickly and make it animated and make it push over the Domino so shift a on my keyboard will bring up the add menu I'll add a UV sphere there it is I'll make it a little bit smaller by tapping s I'll grab it and put it over here I'm gonna scale it I'll use my scale tool and drag it to make it skinnier and longer on the x-axis and I want to enemy if you're not familiar with adding keyframes and animating or you want to learn a little bit more in that perhaps check out my video that's from a few months ago on animation in planar 2.8 in that video I show you lots of things like getting into curves and the dope sheet editor and how to animate properties like colors so what object can change colors over time or have their properties changed over time lots of great stuff in that video ok so if you are familiar with animation you know that this auto King button is the easiest way to insert keyframes I'm going to go with the auto keying button turned on to frame and this is still simulating but I know that this Domino is right on this line in my grid so I'm gonna frame 30 I'm gonna ignore how that's that's looking there and on frame 30 I'm going to move my in fact I'll just use the G key I'm gonna put my finger right here not quite yet pushing the first domino and I thought Auto key turned on so that means the finger has a keyframe and we've told it to be there at that time I'm gonna go to frame 40 and move it all top G so that it's gonna hit where that line is the domino and it has a keyframe there because all oakiness turned on I'm gonna frame 50 and move it back so I'll use G and just move it back so I've got three keyframes it's gonna be before not hitting the first domino it's gonna be then moving forward and intersecting where that Domino is and it's gonna come back and by that time hopefully this one at least has been pushed over let's go ahead and go back to frame 0 the simulations kind of messed up now if I select it yeah it's kind of not working but if we start from zero and press play let's go and see what happens and you know what I need to go back to the beginning and do I just want to delete that one yeah and I'll just duplicate this one shift e and then X and yeah I'll just put it there okay I had Auto key turned on by accident so I'll turn that off and I'll delete my keyframe make sure you don't put any keyframes on objects that are gonna be simulator okay that will mess them up so I have no keyframes on any dominoes I've got keyframes on the finger let's go and press play and it seemed lates but the finger went through the Domino it didn't push it over we need to make this finger object a rigid body physics object so I'm gonna go back to frame 1 I know with my finger selected I'm gonna make it a rigid body object the key here is to enable animation making an animated rigidbody object if I don't if I'd leave it as an active object it'll just ignore its keyframes and it'll just fall and the keyframes will mean nothing if I go back to the beginning and enable animation it will now no longer really act like an active object it'll still have its shape it'll be a convex hull east by default but it will not fall it will not be able to be pushed around so really it'll act like an animated passive object and for that reason I mean this will work if I press play and I simulate it'll push the dominoes over quite nicely but if I change this to passive it'll do the same thing but I think passive makes more sense to me unless you want to actually animate this value and turn animate it off and on I think it makes more sense to make your I mean objects passive objects that are animated rather than active objects that are animated nothing that makes a huge difference but it makes more sense to me so from frame zero I'm gonna press play I'm gonna simulate it's gonna knock over the dominoes and that's how you make animated objects part of your physics scene and use their animations that's great I will note that if you have your scene settings in for my scene for this scene for some reason if you use a steps per second that's different you might get it acting kind of weird I think I prefer for this scene 60 the default steps per second so that's under the scene tab again under your body world settings and I press play I think about the beginning and press play now it'll Reece immolate and I don't know if that looked any better but sometimes it does okay just keep that in mind okay let's go ahead now and make our last kind of mini project of this video which is that chain wrecking ball scene knocking over all the Jenga blocks let's go ahead and delete some of these objects we don't need any of our physics objects except for the ground and so I'll select all those and delete those and let's go ahead and add a new cube to be a Jenga block I'll go up to add mesh cube and a Jenga block is three times as long as it is wide and that's because they'll need to be three wide and three deep is essentially in the stack of three by three and each alternating stack row layer is turned by 90 degrees in order to make all these finger bricks we're not gonna duplicate manually and place them all manually we're gonna use a modifier called the array modifier before we get there though let's actually scale this down so I'm going to tap with the cube selected s and then Z and I'm gonna scale it up and down I don't really care how tall it is that can be up to you I am gonna scale it on the y-axis now so I'll tap s and then Y to scale it only like in that direction this time I know I'm gonna want to type after s and then Y 3.03 and press Enter that's because I know I want to be exactly three times or more than three times longer here than here because they're gonna be twisted and in layers and stacked in that way so a good practice here is to apply scaling before you enable physics or an object I'm not sure that you need to in one or two point eight but if you scale an object I would go up to object apply and scale and that means and it'll tell better that that's really the actual size of the object again I think in product 0.8 they've solved this it might just be an unneeded precaution but it's not a bad idea so this is just a mesh right now I'm gonna go to the physics tab and enable it as a rigid body I need to go back to frame 1 so it's not playing with me and weird 460 ways and I'm gonna turn the mass down this is your 0.5 so it's lighter I might as well move it a little bit closer to the ground it's a little bit above the ground a little bit over and I want there to be three in a row and I'm not gonna duplicate these manually in fact before I change anything I'm gonna point out that I have a convex hull here it wouldn't make more sense for me to have this as a box and after I make all my Jango bricks I could fix them the way I changed all my settings at once of my dominoes but I'm just gonna fix it right now so box okay that's better than convex hull if I want to make more Jenga bricks I'm going to go to the wrench tab which is how you add modifiers modifiers if you're not familiar because I haven't covered these in my previous videos in this tutorial series modifiers are ways of procedurally changing a mesh or adding to your scene in a way that again is procedural that means like mathematical or using an algorithm not editing it manually these modifiers on the wrench tab you could add a modifier to different objects one of them is called the array modifier under the generate column so under the wrench tab add modifier array an array if you're a programmer you know andreas an array is a bunch of copies of the same kind of an object usually ordered or in a row there are multi-dimensional arrays of basically arrays of arrays in this case with physical objects you have offset numbers which is how many or how spaced out objects are in a physical space you have a count number how many objects copies of the original one that you want so if you turn this number up three four five six you get more and more copies don't worry about this extra bounding box the offset is how spaced out they are so you can see that's what it looks like you can space them out in fact I'm gonna space them out this is a relative offset amount and these three columns are for XY and Z so if you change these numbers you can make like staircases and you can make them go in different directions but I want zero and zero for y and z I want the relative offset number to be a little bit higher than one like one point zero or one point zero one and that means that there's a little gap between each one which is good that means they're separate and I only want three yeah so three including the original which is three okay so we've got our three in a row now the settings for the three are a little bit weird the bounding box the occlusion shape is gonna be a little off we'll fix that but I'm gonna press apply okay and that means it's gonna be one mesh which is weird if I press tab they're all in the same mesh don't worry it will fix that later before we do I'm gonna make another array of these three so we can have them all in a stack so I'm gonna add a modifier I'm gonna make it an array this time I'm not gonna offset up on the x-axis I'll click and type zero and press Enter I'm gonna make them go up on the z-axis and I don't want just one coffee or two in total I want to have probably twelve okay the reason why I want twelve and them spaced out is because we're gonna have a duplicate stack and we're gonna turn them that by 90 degrees on the z axis so they're facing 90 degrees differently so they're all alternating just like the game Jenga would be so I'm gonna make these spaced out by two point zero three and I'll press Enter and that way they'll be spaced out just enough that a whole duplicate stack can fit each a new row can fit in between each one with a little tiny gap in between that's good don't worry about this bounding box that's wrong we'll fix that but I'm gonna press apply when you apply a modifier it makes it permanent and so now we have us permanent mesh that's gonna actually weird if I try to simulate this yeah it works very well so uh don't worry about that we'll go back to frame 0 and we're gonna duplicate this so I don't go to my top view if you press the 7 key on your numpad or you press the little Z so go up here you can go to the top exact orthographic view and I'm gonna duplicate my Jenga blocks tax so shift D on my keyboard and I'm going to right click to put it right back where it was and I'm gonna tap R from the top view r9 is 0 enter or R and then Z + 9 0 enter if you're looking it from some other view so now there turn the opposite way but I want to make them lined up and I want to have it so that they are alternating so there we go I tap G and I'm fixing that so now if i zoom in I can get that right I don't want them to touch at all and I didn't do quite a good job they're a little bit longer length in the 3 side by side that's okay for this video okay so you - just from the front and the side and there we go I'm happy with that as they're spacing all the way through I think there is I'm gonna select both with shift and I'll join them all together in one big ugly mesh so I'll tap after I select them both that will shift I'll press ctrl J ctrl J will join the two meshes together now I've got this big ugly mesh of a bunch of separate Jenga bricks all in the same mesh it's really easy to separate them though and that's what we're gonna do just press tab to go into edit mode by the way if you're not familiar with how to use edit mode in butter 2.8 if you're not familiar with modeling tools and the concept of going into edit mode on a mesh editing the vertices edges and faces I'll put a video on this it's my video on the introduction to edit mode and modeling input up 2.8 I'll put a link to that video on the screen right now so go check that out if you want to learn some modeling and you're not familiar with what I'm doing right now ok so let's go ahead and make sure everything in edit mode I mean edit mode is selected I'll press oh my keyboard to select all and then I'm gonna press the letter P the letter P brings up the separate menu and I want to select loose parts and so all the bricks are loose parts from one another they're not actually attached so if I click that they will all now be their own mesh but notice that I'm in edit mode still of one of them so I'll press tab to go back into object mode I've got them all selected which is great if I tried to simulate right now it's gonna act really badly and that's because it might do different things for you and that's because all of the origins are all little orange dot which marks where the object kind of is are all in the same spot they're all in the origin of one of your Jenga bricks so even though I select this Jenga brick it thinks the origin of this one is down here and the collision shape is based on where the origin is so in other words the the simulation thinks that all the Jenga bricks are overlapping right here and that's a bad thing so I'm going to press one to go to my front view or you can press the little green dot up there and I'm gonna use my box selection tool and I'm gonna select all my Jenga bricks and it doesn't matter which one is the active one because we're just gonna fix the origin and put the origins all to the middle of each Jenga brick really quick to do that I can right click with all of the brick selected and I can say a set origin I'm in object mode right now by the way set origin to geometry and that'll put the origin to the median point or the average of the geometry of each separate object all at once so origin geometry and look now all the dots are individually the origins are where the actual bricks are so now if I simulate from frame zero one aha look it's good they bounce a little bit because hey they all have to fall a bit but I like it okay so if I go back to the beginning and let it play there it is how could I fix that bounciness I'm really not that sure about that actually you might get less bouncing yes we'll make sure that there is on to the physics tab no bounciness on the floor or anything but that also might be fixed by changing the rate of sampling which I showed you before 100 the scene tab I've got steps per second set to 60 let's try a hundred and twenty and button Django Brooks wouldn't do that a little bit especially if you have them all spaced out and you all go at once there would be some bouncing that would happen and that actually looks better 120 okay if I turn that up it might actually happen less I'm not sure you can try that for yourself so we've got a Jenga tower I'll make my ground a bit bigger by the way I'll click and then I'll go back to the beginning to make that permanent okay let's go ahead and make our our chain and our wrecking ball that's pretty easy I'm gonna go and add a torus a default mesh torus add mesh I'm an object mode right now add mesh a torus it's like a donut and it's gonna be what we're gonna use to make every link of our chain now when you add a torus don't select anything else or change anything just follow along with me because we need to edit this torus there's too many polygons here and we're gonna actually use the mesh of this as a simulation because that'll work best to edit this number of rings and details in this torus and to make it a bit thicker I'm gonna go down to this add torus pop over and expand it if you don't have an add torus one it means that you have selected something else or you've tried moving it or something don't do that open this up first if you've already moved it delete it at a new one let's go ahead and change the number of major and minor segments and the radii so major segments are the ones that go around there's too many of them I'm gonna click and make 24 so it's a lower polygon donut and I'll leave the minor segments which are the ones that go around at 12 that's fine the major radius and then my areas will dictate how big how thick it is and how big the hole is and I kind of like that I'm gonna use these location numbers to move it over a little bit so on the X maybe I'll move it a little bit negative and I'll move it up a little bit like that just so I can see it and now I can go ahead and move it around I'm gonna go to my front view here and I'll tap G and move that up here but I want to make this look more like a link of a gene which is a bit longer in the middle so I'm gonna go into edit mode I'll press tab and I'm gonna grab a couple of edge loops I want to grab the edges so I'm going to edge select mode this whole all the way around there and this one all the way around here to select an edge loop I hold option or alt unlike keyboard if you're on a Mac it's the option key and if you hold alt or option and you click on an edge it'll select all the edges that are next to each other or all in line with each other so that means all the way around so alt click and then I have selected this one as well so opposite each other so I'll hold shift and alt and I'll click on this one so I've got two edge loops selected with the Alt key and the shift alt key and all bevel these two edge loops bevel control B is bevel you can move your mouse away from the middle of your selection and you can spread that one edge loop on each side into two so that's what I've done control beyond do that and we do it control B and move on mouse and left normal click to make it permanent we're doing this because I want to take half of this torus and move it away from the other one so that it's an elongated tourists like link of a chain so to do that I'm going to go into vertices select mode go to my top view and I'm gonna use my selection tools maybe I'll press alt a to deselect and I will use box left and box select half of the donut link and then move those down except watch out when you use box light from the top it will only select the vertices you can see and so that would not be a good thing in order to select things on the backside of what you can't see in the background you can enable x-ray mode up here okay so if I turn x-ray on I can see through the mesh that means I can also select the back faces or the back fur disease so I'm gonna press alt a from the top view use box select click and drag select everything on this side make sure you can you're selecting the top and bottom and then I will use the move tool and move these away so now I've got a link out of a chain I'm gonna press tab to go back into object mode I'll turn off x-ray mode and I think that I need fix the origin of this object to make it in the middle but I'll actually make it rotate a little bit better when I see me like believe it or not so if I right-click with that object selected I can say set origin to geometry and it'll move the the origin to the middle okay so I've got a link of my chain I'm gonna go into my front view and I'm gonna move the first link in my wrecking ball chain right up there and maybe I will rotate it so it's facing my front view so I'll use my rotate tool and I'll rotate it on the x-axis in my case and be a hold control and I'll rotate at 90 degrees I'm watching up here as I'm rotating so I know that I'm rotating when I hold control it'll snap by 5 degree increments like that so now from the front view it looks like that from the side view it's exactly straight up and down I want to duplicate this show so shift D to make another link of my chain and I'm gonna rotate it but facing side to side so I'm gonna grab this the Z row to handle hold control and make sure I rotate it 90 degrees as well okay or you could type our Z 90 and then press Enter but I want to show multiple ways of doing things so I've got these links fairly well lined up I don't care that it's not quite centered like a tap G and just kind of Center that left and right a little bit but they are not physics objects yet I'm gonna make this top one it's gonna be locked the ceiling my non-existent ceiling so I'm gonna go to the physics tab my little earth-moon tab and select a rigidbody and this one's gonna be passive I don't want to fall down it's gonna be bolted to the ceiling this one will be a rigidbody object it'll be active so it'll fall let's go and see what happens if i press play from frame 1 ha it did not work I was hoping for that that happens they broke apart instantly because they think that they are intersecting and they pop away from each other they think that they're intersecting because we're using convex hull convex hull is a simplified wrap around your object when you have a simplified mesh wrap around an object it's kind of like shrink wrapping plastic over it it does not allow holes okay so if because we have a hole this needs to be a mesh which will be more taxing on your simulation on your computer but that's what you need to have that's why we made there be less segments around our default tourists a few minutes ago so I've got mesh on both okay I'm gonna go back to the beginning and press play and it falls that's great let's keep going I'm gonna duplicate that now that we've got it set up properly shift D I'll move it down I'll tap R then Z then 9 0 and enter ok G I'll move up down a little bit so now I've got if I simulate from the beginning the beginnings of a chain and hey why don't I grab both of those and rotate them a little bit and put them back with the G key up there and if I press play hey we've got a nice little beginning of a chain I'm gonna keep going I'll go back go back to frame 1 I'll have both those selected duplicate shifty grab rotate grab ok so I think you get the point if I simulate I think keep going if I don't think this is high enough I might want to use my box selection tool grabbed it all move it on frame 1 and then I can make the chain as long as I want as long as it doesn't hit the ground ok so I can keep going 50 I'll rotate and grab V I want to straighten some of these out because I don't need it to be quite as bendy in some parts okay I'll grab all four maybe even all eight of those shifty I'll rotate and I kind of like that let's actually see how that simulates this play and that looks really really good it it seemed lates it all hits the ground so I'm gonna go back to the first frame I like how long that chain is but from the first frame I'm going to move it all up so I'll use my box like tool G grab put it up there and this last link needs to have a big ball attached to it and I like just adding that in edit mode or actually I might joint together that might be better if I press shift a to bring up the add menu I might add a mesh UV sphere and tap yes to make it bigger it's way down there I'm gonna grab it move it up that's right about there there it is it's looking pretty good and I'm going to join it I'm gonna select this one hold shift select this one control J to join it's one mesh now things rotate in the physics simulation engine in relation or the origin location will actually affect this so I'm gonna right click in object mode and say set origin to geometry and that'll move this dot a bit more in the median of all these different points yes this is a pretty bad mesh because you have two intersecting points in x-ray mode you can see that inside still exists like that that's not ideal ideally you would use different techniques to get these two things attached but without having an inside part most notably the boolean modifier if you're familiar but I have not gone over that yet on this channel so I will leave it at this simple joint method okay this link of the chain should not be one kilogram like all the other links it should be heavier so I'm gonna turn it up to maybe 20 kilograms and I'm going to simulate this press go back the beginning and play and it's just a little bit too long but as you can see it works I'm gonna use my go back beginning use my box selection tool from the front view I'll just move this up a little bit maybe you know what I'm gonna go into edit mode of the wrecking ball so I'll press press tab and I'm going to select only the ball part of it so if I put my mouse over the ball and I tap with nothing else selected if I tap L it'll select the linked parts over my that are under my mouse and if I tap s now I can scale just that part of it so I'm gonna make this bigger and B here there we go all right like that and I will right click in object mode set origin to geometry and I like that better so let's go ahead and simulate and all I hit the ground so back to frame 1 I'll use my selection box tool grab it move it up and that's racing the lake I like it that's pretty cool you'll notice that even though it's playing back in 24 frames per second which is as fast as it really should pretty much if your computer's slower it will play back slower the first time you might try going into wireframe view if it's playing back too slow for your liking when you render out a movie file it will play back at the right rate so keep that in mind that might help you out I'll go back to solid view though it's playing that really slowly though I'm not sure if I mentioned this before but you can change the speed of your simulation again this is a gigantic scene with huge like 10 8 7 5 meter long and your blocks that's why it looks so slow when they film for movie special effects when they film miniatures like miniature spaceships or mint or fires or explosions or Street cities being blown up when they film miniatures they film a high frame rate and they slow it down because bigger objects move slower in this case we want these big objects to look small so we can make it look faster simulate faster so under the scene tab under the rigidbody world settings under settings we can change the speed of our simulation which is right here in the scene tab so if I say speed is 3 it'll play back 3 times as fast which let make it look like it's a smaller hole setup so I'll go back to beginning I'll press play as you can see it all happens quicker and if you actually have a small setup it wouldn't move quicker because things move at a rate that's in relation to gravity on earth no matter how big they are and so if that means I mean less space it's gonna move that space in less time so it's going to look quicker ok so if I go and watch this again I'll speed this part of it you up there we go it's wrecking into the or knocking over the Tanger bricks and that looks pretty good you can be the judge if you think that's too fast we're not fast enough enough but I'll leave it at 3 for now and I've simulated so we're pretty much done here a couple of things if you want to save this simulation and not have it kind of be disruptive bullet want to change things in your scene if you want to lock this down and make it permanent the simulation you can go under the scene tab and you can do what's called bake your simulation baking a simulation means you're making it permanent you're kind of gonna be making this cash bar dark and therefore you can't change or mess things up when you try to move objects in your scene okay so if I click bake it'll Reece immolate and lock bake in my simulation if I say current cash to bake which I'll do right now it will make this bar darker no matter what object you have selected and now you can't mess things up you can save your blender file close your blender file and open it back up and your simulation should be intact okay if however you want to really make your simulation permanent by the way you can also delete your bake if you ever want to undo it and are--some late you it's not 100% permanent you can undo it yourself or reset or undo this invasion yourself but if you ever want to edit your simulation like with z frames you can select all of your objects so if I press a in object mode it'll select everything in my scene and if you want to turn this cache into key frames for every object you can go up to object and a rigidbody and bake two key frames I'm not sure where this option is or if it is over here somewhere update all the frame is something different I think but it is up here with every object selected if I go to object rigidbody and bake two key frames this might take your computer 10 - 1 minute to do it might even crash your computer so it's a good idea to save this under file before you do this I'm gonna live dangerously so I'm going to select bake two keyframes and it's gonna ask me weird I want to start well on a bake from frame 1 to 500 yes I do do I wanna bake dissimulation to every single keyframe that means every objects gonna have 500 keyframes pretty much if you want to skip over do every other keyframe or every five keyframes you can but that means that you're gonna be relying on interpolation between keyframes which will be less accurate and for your links of the chain it might look like the chain links are coming apart because it's not tracking or every link of the chain or everywhere every Domino is or jenkin brick is for every single frame so I would leave it at one for the most accuracy every single keyframe okay I'll press okay okay so what took my computer about 15 seconds to go through there are lots of objects here if I look at my timeline you can see if I go to an object if i zoom in yeah that's a lot of keyframes every single keyframe all 500 are there sometimes objects won't have every single keyframe especially if those objects don't move for a while although it's not very smart there's still a bunch of keyframes even though it's not moving at all so you are wasting a lot of data and if you ever want to let's say fix or animate yourself some of these Jenga bricks well you'll have to change these and pare down these keyframes so you have enough that you can actually manage them yourself there are techniques for that I'm not gonna get into that in this video that really will be it for this video I think we've got a pretty good result and hope hopefully you've learned how to use the rigid body simulation fairly well if you haven't tried this project out it's kind of fun and it's pretty cool looking especially if you add materials to everything and render it out to a movie file but that will be it for this video of course if you like this video for them something please go ahead and click on that like button below this video it really helps me in my channel out and helps my channel grow if you want to see more videos like this one in blender 2.8 and in the Godot game engine click on that subscribe button as well and click on the bell icon below this video if you want to be notified whenever I upload a new tutorial check out my facebook page at facebook.com slash born CG on that page I post updates most frequently there that's my most frequently used social media platform so you guys know what I'm working on next and you get to see things from me outside of YouTube but that'll be it for this video thank you so much for watching we'll see you next one [Music] you
Info
Channel: BornCG
Views: 23,306
Rating: undefined out of 5
Keywords: Blender, tutorial, lesson, 3D, model, modeling, modelling, beginner, physics, simulation, gravity, rigid, rigidbody, body, cache, animation, keyframe
Id: KkKyxecbsxY
Channel Id: undefined
Length: 55min 6sec (3306 seconds)
Published: Tue Feb 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.