Blender to MSFS Tutorial - Follow Path animation - with real world Google Earth (or OSM) data

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
my dear friend welcome back to another blender 2 microsoft flex simulator tutorial and in today's video i wanted to show you how to make an object that moves along a specific path and also can cut the grass which can be handy spring isn't it of course you can use this method uh not only for a tractor but also for um say an airport vehicle or maybe a drone or maybe near your airport you have some trains and you want to animate that or maybe a boat so let's see what we needed to make this so first of all we need a model to be animated and go to my friend google here and i'm gonna search for a tractor 3d model and i'm gonna pick maybe the first result here and this is the tractor that i'm using it is a free object a nice model uh from the guy [Music] it is san albara and you can download it for free and use it for free even in paywear product so let's download this and of course you need an account here it's free and i'm gonna save this in my download folder and open it and inside this we have and then the texture and we have also an fbx and our obj so i'm gonna unzip this and then i'm gonna import this into the blender so get rid of the default cube file import i'm gonna go with the obj here from the download folder here it is tractor.obj okay and zooming i can see that the tractor has been imported so i'm gonna grab this and move it to the middle of my scene this can be okay but let's move this here okay i'm gonna switch to the texture if the texture got imported well no they didn't so for this material i'm gonna use the mfs standard material i'm going to select the texture that come with the tractor and here it is the texture pretty pretty ready to be used okay so actually let's see how big the structure is so we can take the ruler and it is 125 meters long which is pretty much too big for a normal tractor and this is pretty common with the object you download from the internet they have the scale of or maybe some strange rotation and we need to have the um oh here um i click the panel the letter n on my keyboard and we need to zero the rotation and also have the scale at one but also the location should be zero and also the dimension of the object should be uh the one that we did the real one so i'm going to press scale oh okay maybe i'm going to put your region of the object to the 3d cursor so it is here so i'm gonna scale it down so if dimension are the real one uh so this is four meters long now by now i mean yeah this is 6.31 and press ctrl a apply all transform select the object ctrl a to apply all transforms so scale is one rotation is zero location is zero is now six point three meters and this uh destructor is a john deere so let's google the the right dimension for the tractor and this looks like to be maybe five meters long so it's still still a little a little bit too [Music] it's a little bit too big so i can scale it down again scale it okay so this should be nice ctrl a apply all transform and bring back to zero okay control a apply all transform so the the dimension of the tractor now are okay but the tractor is all in one piece so if i want to move the the tractor i can move it but i can move the um the wheels of the tractor separately can turn the wheels of the structure so i have to separate them from the main model and to separate them i go to edit mode i click on the wheel i'm gonna press l to select all the elements that are connected and this is the wheel so i'm gonna press p to separate people like papa to separate this selection and this this selection will be uh will left will forward dot l is left and i'm gonna do the same thing for this wheel b to separate the selection and this will be wheel forward dot right and the same for the rear ones and then we have the main structure of the tractor and also the wheels we wanted the the the glass of the tractor being another material so i'm gonna select them i'm gonna add the new material and i'm gonna call that glass and this will be an mfs glass okay and the properties of this mf class are all the property of the glass itself are all inside the base called pretty much all decide the base color so the alpha that is the transparency and is here the color this pretty dark one so let's make like this and also we need to go down with the roughness and the roughness of glass is 0.02 maybe okay and i want to apply the new material to the surface okay now we have no interior so we need to create the the seat of the tractor uh the the cockpit of the tractor if you want to see through uh but this is not the reason of this tutorial this is not the scope of this tutorial because we want the tractor to be moving and to to make this moving uh i'm going to create an um a point where all the other stuff of the tractor will be attached so i'm gonna be in object mode and i'm gonna add an empty and this is the empty and then cola i'm gonna call this uh tractor made and to destructor main i'm gonna parent i'm gonna select the object when apparent i'm gonna shift click the parent and i ctrl p to parent the object to the main so when i move the main the other stuff will move along with the main and also i want to parent the the weaves to the main structure because the wheels are children of the main structure so i'm gonna click them shift click ctrl p parent to object and also for the other ctrl p part two object this one ctrl p part two object ctrl b and parent to object so when i move the structure or the wheels gonna move i want to move the parent all the structure can move but they can move they will separate it from each other now we need to do the wheel animation and it's a very basic animation but to do this we need to put the origin of each wheel at the center of the wheel how to do this pretty basic i'm going to select the middle of the wheel shift s shift s cursor to select it and it's like in the middle yeah pretty much like in the middle and right object mode we are in object mode right click set the region to 3d cursor and now the origin is to try the cursor so if we rotate along the x-axis we can see that the root well is going to let's do the same thing for the other wheel we can be more precise with the with the placement but again this is not needed for this tutorial and now we need to make the an animation of uh of the well and they will gonna rotate in how does a wheel rotate maybe when the is going forward it's gonna have to rotate forward this direction is it okay let's google it [Music] well moving forward the wheels rotate counterclockwise okay pretty pretty much there we are pretty much there so i'm gonna go to the animation tab here i like to see the texture and i have selected the forward left wheel and i'm gonna insert a keyframe a rotation keyframe in this case um this rotation keyframe wall will be i don't know maybe 50 frame long yes 70 frame rate could be okay and i'm gonna insert another location keyframe then i want to rotate this by 360 degrees forward yeah 359 degrees here insert a rotation keyframe so if we move forward the wheel is going to rotate forward fantastic so let's give this an interpolation mode linear and if you play the animation the wheel will spin great and let's go to the action editor here oh let's here action editor and this will be wheel rotation and i'm gonna push down this animation and you know what all the ways are rotate pretty much in the same way so we can select the wheel rotation also for this and push this one and the wheel rotation also for this and push the one and the wheel rotation also for this and push this down so when we play the animation all the wheels are rotating that's planted let's go to the non-linear animation here and we're gonna give this all will underscore rotation name okay so now that we have done with the rotating animation we can create a path so we can move the tractor the wool tractor along that path and that to create a path you can create it manually and you need to make a shape for um for this path so i'm gonna hide the detector here and press h to i and at the origin of the word i'm gonna add plane edit mode vertex mode merge at center so i have only one vertices and now i can extrude the vertices e y by say 100 meters and e x by 30 meters and e y minus 100 meters and e x minus 30 meters so i have created a simple path so let's merge oh yeah so we can merge this because we have two two vertices and now i'm gonna select all the point ctrl shift b so we can bevel with the scrolling mouse we can reduce the number of bubble because we want the tractor to follow a smooth curve when it turns this is a mesh and we want to convert this to a curve we can unite the tractor structure and then let's begin the magic so we select the tractor main we select the empty of the tractor and we're gonna add an object constraint here and we'll be a follow path and as a target of our path we're gonna select our curve here and now i'm gonna click follow curve and animate path so the tractor gone uh right here to the path and if you click play the tractor will follow the path this is a pretty fast because this is 100 meters long and to solve this you can go to the path here and in its curve properties you can see that this is a path animation and in the frames i'm going to give this maybe 2000 frame so now if we play the animation the tractor it's gonna follow the path accordingly sweet okay so this is one method of doing this and while animating the tractor in its object constraint you can see that there's a forward axis and maybe you can have your object flipped and if we change the the forward axis or the axis the the tractor will be following the curve in the right direction okay so uh let's see another method to create the the curve and this involves um an addon that is called the osm blender awesome and google earth let's see how to do this so now that now we are in google earth i'm gonna use the path tool here and i'm going to click whatever i want a point of my path remember that you can use to move here the the waste key and when i satisfied i'm gonna click ok and i'm gonna save this everywhere on my pc as tractor lineage so google earth export a kml file and we need another tool to convert this to a gp x file to a gpx track i'm gonna use the gps visualizer convert a file i want the output to be a gpx and my input file will be detractor lineago press convert it's pretty fast and see then we're gonna import this into the blender and to import that i'm gonna use the blender osmo addon which is here and you can put it on [Music] a nice amount or even zero and please click play and this will give you a zip file to install in blender it's it's free yeah you can you can pay the this zero so if you see this zero or more and if you like the addon you can pay again donate to the pro architecture user so go back into the blender and we can install the addon the user way so edit preferences install and in downloads we're going to select the zip blender on and install the addon and activate it and the addon is here in the end panel and to import it to the track you're gonna do this in this panel here i'm going to select gpx and import well i'm going to set the file here accept and import the gpx file and here is then the track that we have just created in in google alert and then gps visualizer that is ready to be animated i want the origin of this track to the word origin so i'm gonna go in edit mode and let's merge this so this is a curve and we want it to to be an object and convert it to a mesh and go to edit mode and merge this at center and like we have done with the when we created the path we can go in edit mode select all ctrl shift b and now all the edges are smoothies perfect and the origin of this is here that is in the rear of the runway edit mode shift test cursor to select it and i'm going to go to the set reads in origin to 3d cursor and now i want to move this to zero okay so the scale is one rotation is zero and rotation is zero great and now we can convert this to a curve and like we have already done before i deleted the previous constraint so go to the constraint tab add the logic constraint follow path select the new path follow curve and animate the path okay it's moving along the path pretty fast pretty damn fast so we select the track here and we make this maybe 10 000 frame which make this this speed here also the length of our animation will be 10 000 start it's gonna be zero and to export this animation and this this is uh this is not in the um in the dop sheet as you can see there is no data here in the action editor because we need to bake this animation and to bake the animation we need to select the empty ear the tractor domain go to object animation i'm gonna click bake action and we're gonna bake the all actions so from zero to ten thousand we have no bones here so doesn't matter we can click visual keying we can clear the constraints let's remove the the constraint we have the added before and then we can click ok and let's make blender do its thing it's 10 000 frame that is going to be based it takes maybe 10 to 20 seconds and now we have a bunch of keyframes here and every frame as a location and uh and a rotation inside it uh it is also a scale that we don't need so we can i'm i'm i mean the action editor here those sheet action editor and if we right scale this is not needed but i take away a bit of space here from the fire and the skate is not needed you can see the tractor is moving so this action is gonna be tractor moving i'm gonna push down in the nla editor and there it is an action for the tractor main i'm gonna call this tractor oh okay now we are good to export our object so let's save maybe let's save this file here in our model it package sources because even this object is moving is a static object it's a simple scenario object and then i'm gonna call this ladle tractor to tutorial and save and then i go to the export settings yeah this will be our idl tutorial okay now well there's a another thing that i forgot to tell you and we have an object that is moving but the origin of the object for flex simulator will stay always in the same place okay so when the object is away from the camera will disappear so we should make it the bigger we select the object go into edit mode and add the cube here and skate it and scale it and scale it big cube a big dog object that will take a bit of time to disappear uh of course we don't want the texture of the tractor here so i'm gonna add a new material to this the sign that is going to be our height material or invisible hidden visible that will be an mfs invisible material here it is let's make the alpha 2 0 and also the alpha here to 0. okay so you can see that the cube is moving along with our object okay great so i'm going to generate an xml for this our right the uid the folder will be the i'll idr tractor tutorial accept and i'm gonna click export we now have the lidl tractor tutorial with its xml now we need to add the two line for the animation and one animation is tractor moving and the other animation is wheel rotation of course remember to give each animation its own uid now we can save compile this and of course i'm going to use the trusty fs package tool and then go into microsoft flight simulator and try our new moving object so now i've loaded up my scenery and then now i can go to the puzzle simulation because the objective will be moving and it's gonna be pretty hard to position and go to the object and search for the old tractor oh lady attract tutorial that's the scene and here is the object so the first position of the object is gonna be right there yeah and now if we resume the simulation you can see the detractor is now doing its stuff is now playing the animation let's save the save scenery but we want to cut the grass this is the promise that i made at the beginning of the video and it's pretty simple so let's go back in blender and we can add an object here i'm gonna do maybe like this in the modeling yeah uh we can add the shift s cursor to select it and add a cube and i want this cube to be just a little bit above the ground the scoop should never touch the ground this will be enough i'm gonna parent this to the empty control p parent two objects so when we move the empty also this thing moves and to this i'm gonna add a new material and this new material will be a special mfs material can i click this here yes and this is gonna be an environment environment occluder here it is now if we export this now in the back of the tractor the grass has been cut of course i don't want this to be uh here in the in the back of the tractor it's just a simple trick but it is a very endy object that they have made before this is just a simple cube and you can cut grass with this you can have the grass at the height you want but remember you don't want to this to go below the ground because when out of the dev mode this will create a huge black hole in your scenery okay so i hope you have liked this uh tutorial and if you haven't already please subscribe and let's see see you in the next tutorial bye
Info
Channel: Federico Pinotti
Views: 5,783
Rating: undefined out of 5
Keywords:
Id: o_Tz89qipkw
Channel Id: undefined
Length: 29min 42sec (1782 seconds)
Published: Mon May 16 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.