Creating FreeCAD assemblies and animations in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in this video we're going to look at how to do an assembly and animation in blender similar to the one i did in my assembly four video which i'll link to uh above so that you can see how to take these models out free cad put them into blender and achieve a similar result i believe a little bit easier than it is to do an assembly for and there's some good reasons you might want to do in blender there are other good reasons why you might want to do an assembly for but this way you have the choice okay so i'm going to keep this intentionally simple i don't want to do anything i don't need to do to get you into blender and animating this part so you'll remember the rod from the the animation here in free cad so i'm just going to select that i'm going to export it and i'm going to export it as rod stl i already did it once that's why it exists there already so i'm just going to overwrite overwrite that one and then i'm going to open up the main body you'll remember the main body from the prior one if you haven't watched that video go ahead and watch that one uh the animation in assembly four you'll see how we do all this in free cad i'll i'll put a link to it up top so i'm going to select this main body and i'm going to export that to the main body stl and say yes i'm gonna overwrite that so that's all i'm gonna do in free cad for now what we're gonna do is we're gonna open up blender and we will use blender to create the animation so the version i use is version 2.92 that's a very latest version that you can download and it will allow you to do everything that i'm doing here i think what i'm doing will work in older versions you may see some some slight differences in the um interface but for the most part everything i'm doing here will work in the uh older versions so i would go with this 2.92 it's the latest release and it it works really well so let's get started so this is blender if you haven't downloaded it already you need to go to the blender website and download your copy it's free it's open source and on the face of it it's very complicated but if you stick with the basics i promise you it's no more complicated than free cad once you get used to it then you can start looking at other aspects of it of course there's a million buttons and things to play with but don't be intimidated give it a go i'm sure you're going to enjoy it so inside blender i just picked a general when you go in when you first start blender it's going to ask you what type of file do you want to work in you can just say general and what it will do is it will show you this default cube we're going to use the default cube just to get our size our scale right and what i'm going to do in this animation is i'm just going to import the parts and scale them roughly to the size of that cube which is way bigger than the parts are i'm not going to go for scale size with dimensions you can do that in blender but you don't need to if you're just going to do a quick assembly also if we make things about the same size as this cube then our camera and our lighting will all work for those parts now i'm not going to do a render of this assembly i'm just going to do the assembly and let you guys play with it after that so first thing i want to do is to bring in my main body so i'm going to say file and import an stl so file import stl and i need to navigate to where i saved those stls i saved them in here and their assembly so the main body i'm going to import it now the important thing is when you import something you can see right now that that has imported it at a scale that is massive it's huge and i don't really care except for i don't want this to be bigger than the default cube because of the camera and the lights and all that stuff so i'm going to scale it down to scale it you just hit s and then you just move your mouse and it will scale and if you watch in the middle there well actually i'm going to zoom in a bit so you can see a bit better if you watch in the middle you'll see the default cube is still there you see the camera you see the lights you see how massive this thing was when it came in that cube is one meter by one meter by one meter so this is this is literally as massive um we don't want it to be massive we can we can go down to sort of that size i think that's fine and again i'm not worried about what the scale is if you look over here you can actually see the scale that i scaled it down to 0.022 and i scale it down evenly in the x y and z i don't care about any of that i'm not going to worry about it um i'm just doing something that looks right this is not supposed to be a scale model now i want to get rid of this default cube so what you can do in this object mode you can select parts so if you look at that the main body is now selected if you look at this the cube is now selected to delete something in blender you just hit x i'll pop up for a confirm delete is gone so now i want to bring in a rod and i'm going to just over this way what's going to happen is it's going to come in in the middle but it's going to be massive so let's let's do that first so we'll bring it in select the rod import and as you can see the rod is massive so i'm going to say scale and again i'm just doing s to scale i'm going to zoom in a bit closer you can see the rod is bigger than the main body at the moment so s again and just keep going down until it gets to size where i'm happy with it and i actually flipped it over there so we'll fix that and it's way too big so i'm going to scan that down i go here you can see where it's sitting in there scale again there we go and that's about the size i want it and i'll show you how to move it as well in a second but for now we're going to sit with it there and it's actually the other way around to the way that we want it so i'm going to rotate it 180 degrees in the x and y plane so just like free cad we're in space here so we have our y plane how do i know that's y if i look up here you can see the y is actually green x is red and the z is blue so the green corresponds to the y and the red corresponds to the x now if i'm turning 180 degrees it doesn't matter if i do it in the x or the y so to rotate in blender it's just r and then you can tell it which axis you want to rotate on so i'm going to just say x and i'm going to rotate it like that and if you look over to the right you can see that i rotated it 179 degrees so what i'm going to do is pop that up just one more 180 degrees so there we have the rod is now the right way up for the way i wanted it and it's roughly the right dimension and okay so i'm going to select that rod shift d and x and that says i want to duplicate it in the x direction and i'm going to go back to the middle one shift d x and move that in the other direction and if i look from the top i can see roughly where i am in terms of uh being in the center there that one's not bad that one's not bad this one i think needs to move down so to move something it's just g for grab and then x and you can just bring it to us roughly in the middle there that looks pretty good you can see actually if you look at the ends of this you can see that we have a view where you're not seeing it straight on it's showing it from the from a bit of perspective so that's why it looks like it's a not quite lined up if you look from underneath you'll see it's actually pretty pretty close so it's close enough for us for our animation now when we want to animate this we can decide if we want to start with them all even or we can move up and down if i want to move these two outside ones down for instance i'm going to select first one hold down shift select the second one then i'm going to say g for grab and i want to just move it in the z direction so z so i'm going to hit z and then i can just pull them down to wherever i want them to be to get started so now i have my start point which is roughly what i think i had in the free cad animation now to animate something in blender it's very easy because you can use keyframes what they call keyframes to tell it where it's going to be at any one time so you really only need to have a couple of keyframes and you're all set in this particular view so we're in the layout view we're going to go down to this line here and we're just going to pull it up a little bit and now if you look here i have this what looks like a timeline or is a timeline and if i press play it'll play that nothing's moving because i haven't told it to move anything yet but that's playing each frame and in our case i don't think we need uh 250 frames that's what it defaults to so if you look here you have a start frame and an end frame so i can roll the end frame back and all i'm doing is i'm clicking on the number and then just move my mouse to the left and i'll roll it back so let's say we just go with a hundred frames we'll just work inside of there and go with that so you can also if you look at these little arrows on the end you can move it up and down by one so when i roll back it went to 99 it just clicked that right arrow and it went up again so now this bar the play and pause bar it has this arrow with a line on it that'll take you back to the beginning so that's where we are at the beginning now what i want to do is i want to say with these here this is their start point so i want to tell it that it's going to be starting there so so on this right hand side here you can see all these different icons this one with the square inside some i think they're brackets or something this it pops up there says object properties so that tells me the location of the object now what i'm going to do is i'm going to apply my scale so everything is scaled i'm just going to go ahead and apply that by saying i'm gonna select the main body hold down shift select my three rods say object and apply and scale so now you can see the scale goes back to one and i can say object apply rotation so now my rotation is zero and i'm going to say object apply location and all my locations are 0. the reason i've done that is just to make everything simple it's all zeros instead of being all those odd numbers that were on there now what i want to do is select my rod and you can see when i select different rods if you if you watch here you can see this is rod 3 this is rod one and this is rod two we can rename those if we want to we don't have to it's not complicated enough to rename so all we need to know is that rod one is is the one in the middle also um you can see from here you can select those bodies so i can select rod three rod two rod one i actually have the original rod there which i am going to hide there we go i had two rods there i managed to duplicate it in the same place so what i'm going to do now is i'm going to tell it this is where i want this rod to start from so if i select this rod and i select this point over here these are my keyframes and you'll see that over here these little key frames come on so that says that rod is gonna be there at frame one so i'm gonna do the same thing for this rod keyframes for the first frame then i'm going to move it to the 40th frame and now i'm going to say this rod is going to be moving up so i'm going to actually take i'm going to select this rod in this rod because i want to go in unison and i'm going to say g for grab z for the direction i want to go in and i'm going to move them up to here and just click and now you can see the z direction has changed so what i'm going to do is i'm going to select each rod and click the keyframe select the rod click the keyframe now if i run this animation you'll see that when it goes back to zero they start from there and they come up it automatically figures out where you want to get to and how it gets there so i can go back to frame 40 if i use this arrow with this keyframe indicator on it i'll just jump back to that keyframe and then i'm going to say select this guy and give him g and z and pull him down to where i want him to be and then give him a keyframe now if i wanted to be the exact same amount of offset as this guy i can set these numbers if i want to but i'm just doing it by eye because it's very simple so if you watch now starts there pops up and then it stops we want it to go back to the beginning so we can say move this to 90 and simply change this to zero and hit the keyframe select the next one change that to zero hit the keyframe select that one change that to zero remember we started at zero so we know that's back where we started from and now if we run it you'll see that they move up and then they move down and then they're going to move up and then they move down and that's simply how you get to an animation now one of the advantages of blender is i can turn this around i can look at it from any angle and have that run we can see what it looks like we can also look at it through the camera view if you remember we have the camera view and we can run that up and down that simply so now i want to do some bonus footage if you all you wanted to do was um the animation you've already seen that and i'm not going to do any more with this main body in these rods we're going to leave the animation right there it's basically what happened in freecad but that's how you do it in blender now i'm going to show you the physics part so you saw at the beginning of this video i showed some video of a ball hitting two blocks and that ball moves the blocks and that's the physics part of blender and i think that is really a powerful tool particularly if you are simulating something with parts that you've designed in freecad because you can't do that what i'm going to do is i'm going to show you how to do that physics part it's fairly simple and it will walk you through how to create stuff in blender and again baby steps if we do it a little bit at a time you'll soon become familiar with blender as you have with freecad so from here from where we are i'm gonna get out the camera view i'm just gonna start a new file so i'm gonna say new general again there is that default cube what i'm going to do when you start a file the default cube is actually in the middle of space and i want to bring it up to the top so i'm going to turn on this little magnet up here it's this this does snapping you can play with this but i'm just going to turn it on for now and i'm going to do a g to grab this cube and a z to move it up and i'm going to bring it back down just drop it there and now if you look it's sitting on that surface so that's all i wanted to do i'm going to turn my magnet off for now and we're going to duplicate that we're going to have two cubes because we're going to create something similar to what i showed at the beginning of the video so the next thing we want is a floor so we're going to add a mesh and it's going to be a plane and we're going to use that scale command again so we just hit the s and we drag it out and make it a decent size so that we've got some floor and then we want to add a ball so again it's add mesh and in this case we're going to say a uv sphere so we're just adding a ball everything adds in the middle there so we're going to g and we're going to z we'll just move it up a bit and we're going to g and x i'm going to just move it to that side just put it there and simply that ball is floating in the air at the moment and that cube is sitting there we've got a little bit of space behind it because we're going to knock the cube and if we want to rotate that cube a little bit so it's not face on so we're going to click on the cube r and then z because we just want to rotate around the z axis and we're just going to drag it around so we'll put it there now what we're going to do is we are going to add a second cube so shift d for duplicate and z to go up and we're just going to sit it up in space so sitting up in space at the moment the reason i'm doing that is because when you do these animations if you have them overlapping when you turn it on it will jump up in the air because it'll try and um react to the fact that it's overlapping because you can't overlap in space so it really does that so so i'm gonna take that cube and i'm gonna rotate that one in the z axis i'm just going to turn it a little bit so it's so not dead straight i'm going to turn on my magnet again and i'm going to move it down and settle it on top of that guy wait that's not right i see what it's doing so it's trying to take that center point and put it on the top so now it is overlapping by a half well i know these cubes are one meter high so what i'm gonna do is i will i can just type in three and now they keep sitting dead on top so they are everything is fine as it stands so now if i run the animation i've got nothing happening and i'm going to pull it up again like we did in the with our other animation we're just going to pull up so we can see that timeline and nothing is happening and our timeline is 250 frames i only want the timeline to be about 60 so i'm going to type in 60 there you can see now if i press play it's only going to play 60 frames okay so i'm going to set this cursor back to the beginning and i'm going to take this ball and we're going to add some physics to this ball so what we're going to do is we're going to go over here if you look on these icons i showed you before that this one is the object properties this one it looks like i don't know what it is a rod with some kind of movement around it i guess is physics properties so if i click on that and i say this ball is going to be a rigid body so i just click rigid body don't do anything else now if i press play see how the ball falls to the ground or foot actually falls into space if i turn this this way and keep running you'll see it'll fall into space now the reason is falling into space is gravity so gravity is taking over and this plane doesn't have any physics so the ball just drops right through it so if we make the plane a rigid body but we're going to make the plane a passive rigid body otherwise the plane will just drop down in space as well so we're going to make it passive which means it it's not going to fall down it's just going to stay still so now if i run the animation the ball will fall down and stop on the plane great so how's it going to hit those cubes we wonder well first things first we got to make the cubes have some physics as well so we're going to click on that cube make it a rigid body click on that cube make it a rigid body i'm not going to touch anything else in the rigid body part so now if i if i run those cubes shouldn't move anywhere because they're already sitting on that plane and they're sitting on top of each other so gravity's not making a move the only thing that's moving is the ball through gravity so now what we're going to do is we're going to go back to the beginning of our animation so now we have our ball we're going to select the ball and from the physics we are going to select animated and select that keyframe and then from the properties for its location in x we're going to select the keyframe now we're going to do is move over to frame 10 and we're going to say for that ball g and x so we're going to move it along the x bring it up close to there and we're going to keyframe that position and we're going to keyframe our animation but we're going to turn it off at that point and keyframe it so now what's going to happen is when we run this simulation we should see the ball move and hit the blocks so the ball moves hits blocks and you notice the blocks are moving because they're rigid body too and that's basically how you do it now you'll see that in my animation my balls or shiny reflective ball i'm going to leave you to figure that out there's plenty of information on how to do that you can also make these this ball um more round less golf bally looking you can do all of those things and of course if we put it in the camera we can position it properly too because if we look at our camera now our cameras in the not maybe the optimal angle because we're only looking at that square so we're only going to see that piece happen so i showed you how to position the camera in the in the video where i showed you how to do rendering of a free cat model so you can take a look at that too if you want to see more blender ideas and information and integration with freecad you know doing things with cat models leave me a comment below and i'll certainly if if people are interested i'll certainly do more stuff with blender so that you can see how that works but for now i just wanted to show you some simple stuff just to get pick your interest get you going there's lots of videos out there on blender i'm absolutely not an expert in it but i can i can sort of hack my way through but if i get stuck i generally go and look for some youtube videos on blender because there are a lot of people out there who are very good at it and the reason i want to show it to you guys is because i think there's a lot of synergy between free cad and blender not only that they're both free and open source software but the fact that you can so easily take up a free cad model bring it into blender do all kinds of things with it including adding it into videos or you know doing all kinds of uh exciting stuff with it so again if you're interested in seeing more blender stuff please leave me a comment below if you want to see more free cad stuff you can comment that too and by all means subscribe give this video a like and i'll prepare the next one you
Info
Channel: Adventures in creation
Views: 6,162
Rating: undefined out of 5
Keywords: FreeCAD, CNC, CAD, CAM, CNC routing, Design, DIY, woodworking, 3D printing, maker, creativity, art, crafts
Id: V03lxoE2gzg
Channel Id: undefined
Length: 30min 7sec (1807 seconds)
Published: Sat Mar 06 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.