Animation, Rigid Body and Cloth Simulations in Blender 2.91.0

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys and welcome to another blendini tutorial today i wanted to do something a little bit different so i put together a very quick and simple tutorial that introduces some of blender's basic animation and simulation features we'll use this animation here to demonstrate rigid body simulations including collisions with cloth and animated objects from object creation all the way to rendering out a final video file this demonstration also includes basic use of instancing by the way this is the latest version of blender 2.91.0 so if you're still on 2.9 there will be some minor differences none of them will affect your ability to follow along now without any more jabber john let's get started first we'll make the conveyor belt using an array modifier to create a row of slats and then a curve modifier to wrap the array around the curve take the starter cube and scale it down along the z and y axes shift a to add a circle rotate it 90 degrees along the y axis by hitting y and then 9 0 hit the 3 on your number pad to go into side view and with the circle selected tab into edit mode click anywhere away from the circle to deselect its vertices if you don't see the vertices hit 1 on your keyboard to go into vertex select mode now hit b to activate box select mode and select all of the vertices to the right or left of the vertical center line be sure to leave the center vertices unselected grab the selection and pull it back along the y axis tab back into object mode i'll adjust these shapes a bit and now select the objects hit ctrl a to bring up the apply menu and apply rotation and scale select the circle object and go to object set origin origin to geometry then in the same object menu find snap and select selection to cursor notice that the origins for the cube and the circle are perfectly aligned this is critical for our use of the curve modifier with the rectangular cube selected add an array modifier change the relative offset x factor to 0 and the y factor to 1.15 then add a curve modifier now convert the circle mesh to a curve select the circle go to the object menu find convert to and select curve select the cube again and in the curve modifier select the circle as the curve object and change the d form axis to negative y then adjust the count in the array modifier until the slats wrap around the entire curve to fine-tune the spacing hold the shift key and scrub the y-factor value with your mouse now we have a conveyor belt that can be animated by moving the rectangular cube along the y-axis if you'll notice as i move the object's origin along the y-axis the bottom of the belt's animation moves in the same direction but the top moves in the opposite direction since our object is going around our curve but for the sake of our animation we want the top of the belt to move in the same direction as the object's origin to fix this simply rotate the curve along the y-axis 180 degrees if we look closely at the corners of the mesh these planks are slightly deformed to match the curve's rounded corners the more vertices an object has the more it will deform to match a curve but if you want your mesh to retain its shape you can achieve this with object instancing i'll hide this object and quickly recreate the belt using instancing to show the difference add another cube and use it to create another plank add a plane and scale it down until it's slightly larger than the plank apply rotation and scale to both objects parent the plank to the plane by selecting the plank holding shift and then selecting the plane hit control p to bring up the parent menu and select object with the plane selected click the object properties tab and find instancing instancing creates one child object for each vertex or face of the parent object selecting face will give us one plank per plane unchecking these check boxes will hide the instancer which in this case is the parent plane from the viewport or renders i'll keep both visible for now select the plane add an array and curve modifier with the same settings we used before return to the object properties tab to hide the instancer in the viewport and renders as you can see using this method the planks maintain their shape the original child plank is still visible but we can easily hide that by hitting h on the keyboard or clicking the eye icon next to the object in the outliner now this can also be animated in the same way by selecting the plane and transforming it along the y-axis since the plane isn't visible use the outliner to select it both techniques to create a conveyor belt work exactly the same going forward so i'm going to hide this one and return to the first version our animation works with the array modifier but we're going to add objects dropping down onto the conveyor belt using the rigidbody simulator the rigidbody simulator needs a full mesh to interact with so we'll need to apply the array modifier be sure to make any shape adjustments to the plank before applying the array whenever i apply modifiers for the sake of simulation work i usually make a backup object and store it in a backup collection then i hide the backup collection and remove those objects from the view layer by unchecking this box now we can go back to the original object and apply the array modifier earlier we saw how transforming the belt along the y-axis can animate it but we didn't actually keyframe that animation so let's do that now make sure the timeline below is visible the timeline allows us to keyframe start and stop positions and then it interpolates the movement required to get from one keyframe to the next blender adds a keyframe wherever the blue cursor is along that timeline by default the timeline cursor sits on the first frame hit i on your keyboard to bring up the insert keyframe menu select the keyframe that matches the value you plan to animate we only need to animate the location so select location notice a small keyframe diamond added to the first frame of the timeline when selected keyframes appear yellow when unselected they appear white the default interpolation between keyframes ramps up the transformation speed and then slows it down to get from one keyframe to the next often this is desired but our belt needs to move at a continuous or linear rate so with the keyframe selected right click to bring up the dope sheet context menu and find interpolation mode then select linear now move the timeline cursor about 100 frames out this will be the stopping point of the animation so we'll move the object along the y-axis about 10 meters in the positive direction a shorter distance results in a slower moving belt and a longer distance results in a faster moving belt hit i to add a keyframe and once again change the interpolation to linear change the animation duration by lowering the end frame to 100. hit play to see the animation run in a loop with that complete we can now add an object and simulate it dropping onto this animated belt first make sure the timeline cursor is on the first frame by clicking this back to beginning button shift a to add cubes scale it down apply the scale and raise the cube along the z-axis above the belt open the physics properties tab and find rigidbody and select it by default the type is set to active active objects have motion that is controlled by the rigidbody system which is what we want so leave it as active collision shape should match the shape of your object so mesh usually works for all cases but can be memory and performance intensive since this shape is an actual box we'll set the collision shape to the primitive box under sensitivity check collision margin think of this as space around your object that is still considered when calculating collisions under surface response give the object a small bit of friction and bounciness now select the conveyor belt and go to its physics properties tab enable rigidbody here as well passive objects are static objects controlled by the animation system so set this object to passive since the object's mesh doesn't readily fit any of the primitive shapes set the shape to mesh since our conveyor belt is animated check animated under settings and since it changes its shape or deforms with animation check deforming under collisions also give the object a bit of friction and bounciness under surface response now when i hit play the box falls onto and interacts with the animated conveyor belt for what it's worth rigid body objects can also be used with an instance object to demonstrate this i'm duplicating our box and hiding the original since we'll come back to it later i'm going to scale this duplicate down and for the instance object i'm adding an icosphere i'll parent the small cube to the icosphere and set the icosphere's instancing to vertices then i'll hide the instancer from the viewport in render if i play the animation these little boxes retain their rigid body behavior but they are still attached to the ico sphere and move as one to get all the boxes to fall as individual objects they must be turned into individual objects blender makes that easy too so with the children selected go to the object menu find apply and select make instances real this turns each child into its own object when the animation is played they all behave independently falling onto the conveyor belt now we're going to add a cloth simulation so our box passes through a sheet of cloth before it falls off the conveyor's edge add a plane rotate it along the x-axis 90 degrees and move it up along the z-axis position it near the end of the conveyor belt tab into edit mode and right-click to bring up the context menu select subdivide a cloth simulations results improve with the amount of vertices and faces available but higher values here can slow down the simulation for this size we'll use 18 cuts our cloth will be held in place by the top the cloth simulator allows you to specify which vertices should remain unaffected by the simulation select the top row of vertices you can easily do this by holding down alt and clicking on an edge between any two vertices along the top row with these vertices selected go to the object data properties tab under vertex groups click the plus sign to add a new group once in edit mode click assign to assign the selection to the group and now go to the physics properties tab and select cloth the quality steps dramatically affect as the name suggests the quality of the simulation this value determines the number of simulation steps which are sort of like mathematical iterations of the calculations used the higher the number of steps the greater the quality of the simulation but more steps means more time and can be performance intensive 15 steps works well here we'll leave most of these settings as their defaults find the collision section and verify that object collisions is checked then check self collisions if we play the animation now the cloth falls as if a rigid body right through the conveyor belt in order to have the cloth interact with other objects the other objects need collision physics enabled on them select the conveyor belt and on the physics tab enable collision now the cloth interacts with the belt to pin the cloth in place select the cloth and in the cloth simulation settings find the shape section set pin group to the group of pins we created earlier if we play the simulation the cloth stays in place now but the cube passes through all we have to do to fix this is enable collisions on the cube which will give us this animation let's say you wanted to add another cube to this animation you could simply duplicate the existing cube and move it up a bit but what if you wanted to delay the second cube's animation so the boxes don't collide with each other notice that when we check animated in the cube settings it is no longer controlled by the rigidbody system we can keyframe this value as indicated by this little dot next to animated here if we keyframe this value disabling it at the start of the animation and then enabling it when we want the rigid body system to take over we'll get the desired effect let's move the timeline cursor to the first frame check animated and then click the keyframe dot next to it then move the timeline cursor further along the timeline uncheck animated and click the keyframe dot again this effectively delays any rigid body simulation now when we've used instancing before the origins of the parent and child objects were always aligned and we only ever parented one child to an instancer but neither of these are required let's parent this entire scene to one object and use instancing to create an entire room filled with conveyor belts it's a good idea to put all the objects to be parented into one collection now add a plane select all of the objects in the collection and then select the plane last you can hit ctrl p to bring up the parent menu or right click to bring up the object context menu find parent and select object just as before open the object properties tab find instancing select faces and then hide the instancer from the viewport and render next go to the modifier tab and add an array modifier increase the count to create a row of conveyor belts you can add another array modifier with a relative offset in the y direction to create additional rows and all the animations still work [Music] for the final scene i added additional stationary objects so nothing seemed to float in midair [Music] do all these new objects are parented to the same instancer i also added lights and a bin to collect the blocks once they left the conveyor [Music] belt [Music] and then i created some basic procedural materials to render the animation we just have to take a few simple steps the animation and cloth simulations must be baked first go to the object menu find animation and select bake action select your animation start and end frames and then click ok then go to the cloth simulation and find the cache section and click bake all dynamics there are a few settings on the render properties tab that can reduce the time without significantly affecting the render quality adversely for example we can uncheck the reflective and refractive caustics and we can reduce the maximum bounces of the light paths there are also some denoising options that can be applied to the render which will allow our renders to contain fewer samples which will take less time to render out though blender can render video it's best to render animations as an image sequence one image per frame this way if the computer crashes or if you make changes to a small area of the footage you don't need to render the entire project again only the necessary frames will need to be rendered out to render an image sequence go to the output properties tab specify the resolution frame start and end points and in the output section use the folder icon to specify the folder you'd like the images to be saved to the frames will be saved in a numbered order if overwrite is checked the frames will overwrite any files with identical file names so be sure to clear your save folder before rendering select the file format for this project i use png files then hit ctrl f12 or go to the render menu and select render animation once you have your rendered image files you'll need to stitch them together into a video file lucky for us blender also comes with a highly capable video editor to access it go to the editor type button for any panel and select video sequencer select sequence preview for the view type then go to the add menu and select image sequence navigate to the folder containing your rendered images specify the start and end frame for your sequence and then click add image strip be sure to select the frames in order selecting frame one first and then the last frame in your sequence last as this dictates the order in which they are arranged in your image sequence with the image sequence compiled all that remains is to render out a video file go to the output properties tab and for the file format select ffmpeg video under encoding i change the container to mpeg4 and leave all the other settings as they are then go to render and select render animation and here's another look at the final project foreign thanks for checking out my tutorial i hope you liked it if you found it useful please give it a thumbs up and feel free to subscribe to my channel for more blender tutorials and projects let me know what you thought by adding your questions comments and suggestions down below again thanks again for checking out a blandini tutorial have a great day you
Info
Channel: Blendini
Views: 4,956
Rating: undefined out of 5
Keywords: Blender, 2.91.0, Animation, Collisions, Rigid Body, Simulation, Cloth, Instancing, delay, render, image sequence, video file, keyframe, tutorial
Id: 9iQmJzG_8GI
Channel Id: undefined
Length: 21min 14sec (1274 seconds)
Published: Thu Dec 03 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.