Google Sketchup to Blender
Scratch Modeling aircraft can be extremely difficult and time consuming. However if you are able to modify, animate and paint an aircraft, you can still bring brand-new, never before seen in YSFlight aircraft to the digital skies. Google Sketchup is a free 3D modeling tool that many people have used to create beautiful aircraft.
In this tutorial we are going to discuss how to do several things:
Identify potential models to use for a basis for a YSFlight addon.
Open the models in Sketchup and export them so that Blender can recognize the file.
Import models into blender and then align and scale it so that we can begin working on cleaning up the mesh.
Beyond this, we will cover (not in any detail) the process through which you will need to go through to get the model ready for YSFlight. After reviewing this document, you may decide that scratch modeling the aircraft yourself might be easier than going through this process. That is okay and in many situations you will find that to be a better option. However just because something is hard, does not mean that we cannot use it to create some excellent aircraft. I for one have successfully used this method to develop my Boeing 757 Pack.
Without further delay, let us begin!
Identifying Potential Google Sketchup Models
Interestingly enough, this can be one of the most challenging parts of the modeling process because what model you choose will heavily impact the amount of work you need to do.
First head on over to the Google Sketchup 3D Warehouse
At the top of the page is a search bar Start by searching for an aircraft you would like to bring to YSFlight. For this example I used Tu-160. This brought up a bunch of results, but how do you figure out which one you want? For the most part I look to the right and see how many faces a particular model has.
Vertex count (no more than 40-45 thousand unless there is significant extraneous detail like a full set of passenger seats. The Boeing 757 I converted had nearly 200,000 vertices because it had literally every single seat.
Look at the available picture and see if there are any obvious errors in the nose curvature. You will want to avoid models with straight noses where there should be curves. This typically happens on models with 10-15 thousand faces.
To this end, I have found two characteristic examples to highlight what I mean.
Low-poly model page link
Off to the right you can see the number of polygons is around 11,000, and if you look at the model itself, it looks to be of very low quality, something from the very early days of YSFlight
High-Poly model page link
The difference with this model is striking. First we have tons of detail including panels, moving parts like flaps and rudder, spoilerons, and the like. Additionally it has 45,000 faces. This will have a comparable number of vertices.. This may seem like a lot, given that a large YSF model will have around 30,000 vertices, but after the model is cleaned up, the blank will probably be right around 25,000-30,000 vertices. In the end, this will be pushing it, but completely feasible. I find that the largest contribution to the vertex count comes from the text. The small red lettering contributes more than 2,000 vertices all by itself.
This model was chosen to be converted.
Exporting from Google Sketchup
Once you have identified the model you wish to use, we will need to get it into a file-type that blender will recognize. To do this we will need Google Sketchup. Simply open the model.
We will want to export to a .obj file, which is one of the file-types that blender will import natively without any additional scripts. To export we will go to:
File -> Export -> 3D Model
We will then need to save the file somewhere on our computer. I prefer to save it in a folder by itself
Name it whatever you like, but I recommend avoiding spaces in the filename just as a precaution. Make sure that the .obj file type is selected. We will export with the default options.
For this particular model an alert popped up. Do not worry about this and simply click "yes".
When the model has successfully exported, you will get a summary window like this one:
In the end, you will get two files, a .obj, and a .mtl file, both with the name you designated earlier.
But now we need to get this into blender. Close out of Sketchup and fire up blender and go to:
File -> Import -> Wavefront (.obj)...
Select the file you would like to import (obviously the one you just exported from Google Sketchup. You will be prompted with this screen below. You will want to select all three options; Object; Group; Material. If you do not you will get a solid mesh that will take literally hours to tear apart into something that begins to resemble a YSFlight model that we can work with.
Dealing with the Imported Model
When you import the model, you will notice that it is off-center and not aligned like we would expect a YSFlight model to be. With the literally hundreds to thousands of parts, we need a really simple way to work this out.
To do this, we will need to make the center of the fuselage where we want the final model origin to be. As you can see in the image above I have the pink dot (representing the center of the fuselage) right about the center of mass. I took the bottom the the fuselage and found a point on the centerline. Selected it, snapped the cursor to it, and then centered the object center to the cursor. (Press the Center Object button in the button window)
Now, with the cursor still in the same spot, select everything and center every object to the cursor. Now every object should share a centerpoint at the fuselage object center.
Snap the cursor to the blender model center:
Shift -> "c"
Now snap the selected objects to the cursor:
Shift + "s" -> "Selection -> Cursor"
Now the model should look something like this when you are in the Number pad 1 view mode (right side view):
Note that we now have another problem...To fix this, we will have to violate one of my rules in blender - Never rotate in object mode. When we do so, any rotation that we do that is not tied down in an animation will be reversed when you export as a .dnm file. HOWEVER , we can get away with this here because after we work on the mesh and clean it up, we have to export every component as an SRF file. This export process takes whatever position the mesh is in and re-arranges the object orientation so that it aligns with the model center, and the object center is at the model center.
Rotate about the x-axis 90 degrees:
Rotate about the y-axis 180 degrees:
Scaling the Model
To scale the model we need to have a reference dimesion. I like to use wing-span as it is fairly un-ambiguous where the wings end. Sometimes with the aircraft length, you don't know if you have to include or exclude the backwards swept tail fin.
Wikipedia shows that the swept back wingspan is 35.60 meters. This is a great find because blender and the YSFlight scripts use meters to be the blender unit. I make a mesh plane in the x-y plane and scale it so that it is 35.60 meters wide in the y-direction, and 60+ meters in the x-direction so that I can line up the wing wherever it ends up scaling to. If I only scaled the reference plane in the y-direction I couldn't zoom in on the wingtip and see exactly where I needed to scale to.
(A Top view of the Scaled Tu-160. In this image the dark grid lines represents 10 meters.)
Well, now that you have gotten the model into blender, centered, rotated, and scaled to the right dimensions, it is time to clean up the mesh and export each component as an SRF.
If you have any questions you can use the comment system below or shoot me a PM on ysfhq.com.