0% found this document useful (0 votes)
96 views

Object Conversion

This document provides a guide to converting 3D models from SketchUp into usable objects for X-Plane flight simulation software. It outlines a 6 step process: 1) finding and preparing a SketchUp model, 2) converting it for use, 3) getting the conversion script set up, 4) creating folders, 5) using a Python script to convert the model into an X-Plane object file, and 6) placing the new object in X-Plane using an overlay editor. The process allows pre-made SketchUp models to be converted while ensuring texture sizes conform to X-Plane standards, overcoming prior issues.

Uploaded by

daisy ng
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

Object Conversion

This document provides a guide to converting 3D models from SketchUp into usable objects for X-Plane flight simulation software. It outlines a 6 step process: 1) finding and preparing a SketchUp model, 2) converting it for use, 3) getting the conversion script set up, 4) creating folders, 5) using a Python script to convert the model into an X-Plane object file, and 6) placing the new object in X-Plane using an overlay editor. The process allows pre-made SketchUp models to be converted while ensuring texture sizes conform to X-Plane standards, overcoming prior issues.

Uploaded by

daisy ng
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

A guide to using objutil_combined.py to create X-Plane objects.

http://sketchucation.com/forums/viewtopic.php?t=33448

https://www.dropbox.com/sh/cjjwu92mausoh04/AABxwtKzzczZwpW2J8imQGPoa/Utils?dl=0&previe
w=objutils_combined.py

www.easy2convert.com/png2dds/

You will need these 3 things, and a few more, to be able to convert Sketchup models
into useable X-Plane Objects.
There are basically 6 steps in converting a model
1.Finding and preparing the Sketchup model
2.Converting the SK model for use
3. Getting the Script ready to use.
4. Creating a working folder and a scenery folder
5. Converting the Three parts from #2 into an X-plane OBJ using the command line
6. How to place the Object.

It will take much longer to read [or write] this tutorial that it will to convert your first object
once you get everything set up. I’ll tell you as much as I can about what I’ve learned
doing this for about a month now.

1. Finding and preparing the Sketchup model


If you are reading this you probably know where this all starts
https://3dwarehouse.sketchup.com
You also need some form of Sketchup. I’m not going to cover how to download and
install. If you can’t get that done……
You can search the warehouse by entering what or where you are looking for.
I entered Miami

Tip: some times you should look under every one of the combinations, there will be
models of Miami not in Miami, but will be under Miami Beach or Miami fl or Miami
florida. So be patient and keep looking. Also start by looking at collections first .
I’m going to check out the second box, a collection with 49 models in it.

There are two ways to download the model. First you can just click on the box with the
arrow, or you can click on the model and download from the download box
Here’s where a little planning goes a long way. One of the first things I realized was that
almost all the models in the 3DWarehouse have the same name. sk14,sk15,sk16 or
“building in Miami” for example. Also some of them Do have good descriptions, but that
gives them a really long file name, which is really bad in step 5. So here is what I do.
I created a scenery list worksheet that looks like this:
When you download a file you get this in the corner of the window

Click on that arrow and it will take you to your download file. Write the name of the
model and any info on the scenery worksheet and then

renamed to And now you are ready to start the


conversion.
Make sure that you installed the OBJexporter plugin from the beginning of the tutorial.

Start Sketchup and load the model you want to work on, in this case 10
There are a number of things which must be edited out before you can convert.
First: Remove the Tile the model is placed on

Click anywhere it is grey and a menu will open.


If you click and a blue line surrounds the tile choose erase and the tile will vanish.
If you click and a red line appears, chose unlock then erase

This is what it should look like.


Now to get rid of the Shadow

Go to view and uncheck Shadows


Also go to view and open the item Edge Styles and uncheck anything that is checked.
You will learn when you need to do this over time.
When you have done this correctly it should look like this:

Then comes the first bit of magic.

2. Converting the SK model for use


The problem with using pre-made Sketchup models from 3Dwarehouse has been that
the textures did not conform with X-Planes “power of 2” rule. That is why if you attempt
to convert a model using Marginal’s utility, the Object converts fine but the textures do
not.
This is what makes Oscar’s utility so awesome.
Here’s what happens
When you open the plugin OBJexporter , it creates 2 files and 1 folder

The MTL file describes the textures and where they go on the model
The OBJ file describes the 3D model
And the Textures folder contains all of the textures used in the model.
If you have ever looked at the texture file for an X-plane object you know it looks like

this:
{from the CDB Library}

Tip: have patience, it sometimes takes 2-3 minutes to write all this info.
The magic is in converting all those textures into 1, and combining the MTL and OBJ
file,that brings us to

3. Installing Python, and objutils_combined.py


Here is where even I’m a little sketchy on some details as I had to rely on my 20 year
old computer science major daughter and her web designer boyfriend to help me out.
Python
If you are on a Mac, you already have Python installed
For Windows go to www.python.org
Download the most current version.
Make sure that the Python directory in in the main path of your computer.

Go to Oscar Pilote’s Dropbox


https://www.dropbox.com/sh/cjjwu92mausoh04/AABxwtKzzczZwpW2J8imQGPoa/Utils?dl=0&previe
w=objutils_combined.py

Go to the upper right corner and download the file


Also in the same dropbox in the utilities folder is a program called rectpack. Download
that also.
So now we should have Python installed and the python script downloaded.
If you open the script using a text editor, you will see that to comments are in
French.But here is the important stuff that I really can’t explain.

If I was following along when they helped me out, they installed rectpact, image,
imagefilter, imagestat,and numpy.
Hopefully you have an 15 year old computer genius to help with this part.

4. Creating a Conversion and Scenery Folder


Assuming that you get all that stuff installed, the next step is to create the working
conversion folder.
I placed a folder named objconvert in the root directory, and I pinned it in Quick Access.

Place the python script in that folder


Remember the 2 files and 1 folder we go from theOBJconvert process?
Move or copy the MTL, OBJ and Texture to your working folder

Make sure that you create a folder to put the converted objects in after the next step is
finished.
Now you are ready for:

5. Conversion of the Sketchup model to an X-Plane model


Now we go to the wayback machine. Yes…. using the command line.
If you don’t know what that is ask your 65 year old father who had an Apple 1 or
Commodore 64.

Open a command line box CMD


Cd\
Cd ”your working folder ‘

Type python objutils_combined “file name”.obj then enter


In our example for file name it would be 10.obj
When the script is working it takes the textures and makes 1 texture that conforms to
the X=Plane “rule of 2” and and X-Plane OBJ that has the texture information.
The files will be named “file name”-grouped.png and “file name=xplane.obj
Now you can see why I created the scenery list sheet and gave all the SK files numbers
for names. Typing is not my thing, and making a mistake on a file name like
Government_post_office_building_in_miami_fla_usa

Is not fun. So number it is.


Next I move the 2 new files to the folder you created.
Then I check to see if the conversion was successful using Model Converter X
As you can see this one didn’t come out quite right, would I still use it? Maybe if
buildings around it covered up the problem. I’m trying to figure out how to fix this.
There are 2 recurring problems:
1.The textures are not applied correctly
2. missing walls and such
I don’t know how to fix them after conversion, I’m not really sure why it happens at al.
All I know is that the more complex and highly textured models made by really good
Sketchup artists usually have no problems.
Last but not least

6. Placing the models


Since there is no airport involved I use Marginal’s Overlay Editor to place all the objects.
I create a folder with the scenery name for example ”miami”
Create a folder in that folder called Objects
Put the new files in the objects folder
Put the scenery folder in CustomScenery
Open OE
Scroll to the folder
Open the folder, it will take some time, you should have water in the main window and a
list of objects on the right side
Click on the globe with the pin to bring up a satellite photo which will help locate your
mode. When you place the first model and save OE writes the new DSF file.
The last thing which is optional, but needed if you are doing a big city id to convert the
texture PNG to a DDS
I use a free converter www.easy2convert.com/png2dds
Converting to dds saves space[smaller file size] and loads quicker.
So there you have it, feel free to ask questions, there happen to be a number of people
who have got this working.
Again, Oscar, this has brought a whole new thing to X-Plane and I for one can’t
thank you enough for the work of yourself and the others who helped at xplane.fr.
Gary

You might also like