Google Sketchup and 3D Warehouse

#1
I discovered Google Sketchup during the weeked and now I am in love with it. It really is exceptionally easy and fun to use, totally in another league than, say, gmax or Blender. (But, if I already knew well how to use one of those, I might grumble and say Sketchup is a toy, 3D design is supposed to be painful to learn ahd hard to use, or something...:) Keep in mind, though, that Sketchup used to be a sold for something like $500. Now when Google has acquired it, there is a quite adequate gratis version, and a Pro version that still costs about that much.)

Now, from a MS Flight Simulator point of view, the problem of course is how to get from the KMZ format that Sketchup exports to something FS SDK tools can understand. KMZ version 4 files are actually zip archives that contain a very small KML wrapper file and then the actual model is in the COLLADA format, plus any texture images used. So, the problem actually is to get from COLLADA to something the SDK understands.

(Sketchup's native format is .skp, but that is presumably not intended for interoperability and totally undocumented.)

I must confess I am very new at FS 3D object design and haven't actually even gone through any step-by-step tutorial on how to design objects with the (FSX) SDK yet. But from what I have browsed the documentation, the DirectX .x file format is used as the source format at least by some tool.

To convert from COLLADA to DirectX one easily accessible solution (doesn't require buying, stealing or borrowing expensive software) seems to be to use Blender. It has both a COLLADA importer and a DirectX exporter. Unfortunately, one needs to separately download and install a newer version of the Blender COLLADA importer, and even then there are some bugs that need to be worked around: Either the COLLADA importer, Blender itself, or the DirectX exporter don't seem to like the long filenames with relative paths that the .dae (COLLADA) files produced by Sketchup typically contain. The pathnames get truncated into the .x file. So one needs to edit those before feeding the file into Blender. Also, Blender's UI is of course quite quirky.

Anyway, such fixing of pathnames (and corresponding rename of the texture files extracted from the KMZ file) could be automated, and somebody who knows how to script Blender (in Python) probably also could automate the import and export, so that there would be just one command to convert from a .kmz file to a .x file plus a set of texture files.

Then one can download cool buildings from Google 3D Warehouse and put them into the simulator. Cool! I think the 3D Warehouse license even allows redistributing such, so somebody could download all such buildings that aren't already present in FS, convert them to FS, and offer to others.

For designing airport buildings, and maybe even aircraft models, Sketchup, at least to me, looks like a much nicer tool than the traditional ones that have a very steep learning curve...

--tml
 
#2
Hi Tml
Ive developed a work flow using Sketchup to model and texture and then GMax for exporting a mdl.

I agree, it is far far easier to use sketchup but, as you mentioned the free google version doesnt allow exporting of other 3D formats....the payware version does allow export of .3ds which can then be imported in Gmax, the textures re-linked, GUID added and then exported as a .mdl for FSX

I havent yet tried using pre-exisiting models from the 3D warehouse but, by uploading a model there, it gives the right to other people to use and distribute it.....i will look into this when i get some time.

What we really need is for someone to write a 'ruby script' to convert a .skp into .3ds (Ruby is the language that Sketchup uses and is supported in the free version as well)
 
#3
Hi tml,

Not later than two weeks ago, I had the same reaction when trying google sketchup. It is really a pleasant tool to use for a beginner like me. So I also came to the conclusion that an export process was needed (not involving paying software like 3DS).
Another way would be to directly encode the converter as a ruby module for sketchup, since it certainly have API to expose geometry to modules. However I have no knowledge of ruby, so I haven't tested it.
I began reading documentation on Collada and the .X format. The whole process seemed clearly feasible. Both formats are well-documented and easy to read and generate. So I quickly designed a software prototype to had further testing.
The result for simple buildings looks encouraging (see attached screenshots). However I had some problems with "Degenerate Polys" error message in xtomdl or faces not showing up. I finally changed all material to doubleface, but I don't know if this is a clean modelling technique. I tried to convert some models from the warehouse, but FSX seems to accept only square textures (the house on the screenshot comes from the library, but I retextured it).

The idea of reusing models from the google earth community looks interesting, but not totally convincing. Generally people designing buildings for google earth tend to model details (windows, doors, etc) with polys and not texture, because images are heavy to download. On the contrary, in FS, you're almost always looking at the polygon count because of significant performance issues, so you paint details on textures.

I'm not a modeler and I have very few knowledge in 3D concepts, so I don't know if I will continue coding this; However I will be pleased to collaborate if someone is interested. :)
capt1.jpg

capt2.jpg
 
#4
I had some problems with "Degenerate Polys" error message in xtomdl or faces not showing up. I finally changed all material to doubleface, but I don't know if this is a clean modelling technique.
That's a little wasteful. It should be sufficient to just skip those Faces which don't have a material assigned to them.

The SketchUp Ruby API is not well documented. Feel free to use code from my SketchUp -> X-Plane exporter at http://marginal.org.uk/x-planescenery/tools.html.

The idea of reusing models from the google earth community looks interesting, but not totally convincing. Generally people designing buildings for google earth tend to model details (windows, doors, etc) with polys and not texture, because images are heavy to download.
That's my experience too - the models in the 3D Warehouse tend to have prohibitively high polygon counts.
 
Last edited:
#5
However I have no knowledge of ruby
Ditto here...

I began reading documentation on Collada and the .X format. The whole process seemed clearly feasible. Both formats are well-documented and easy to read and generate.
That was my impression, too but I didn't start writing any code yet. What I planned was something like: Read in the COLLADA file, traverse its DOM in memory, constructing the DirectX Mesh structure using the DirectX API, and then have the DirectX API write it out. I would have used C# most likely.

The result for simple buildings looks encouraging (see attached screenshots).
Indeed! Great!

I tried to convert some models from the warehouse, but FSX seems to accept only square textures
Hmm, yes, that is a very traditional restriction I think. I guess that needs to be worked around then in a converter by artificially padding the textures to square (but using just the original rectangular part of them). Hopefully texture rectangles typically aren't extremely narrow which would mean lots of wasted space?

On the contrary, in FS, you're almost always looking at the polygon count because of significant performance issues, so you paint details on textures.
Yes I guess you have a good point. On the other hand, if we are not talking about replicating some generic 3D Warehouse models all over some terrain in large numbers like autogen houses, but just isolated "landmark" buildings, I don't think one or a few occasional such will have a that large polygon count impact? Oh well, experimentation will tell...

However I will be pleased to collaborate if someone is interested. :)
I certainly might be. Could you consider putting your code under some Open Source license and making it available on the web somewhere?

--tml
 
#6
If any .NET programmer (preferrable C#) is interested in this, I have some code where it would be trivial to hook up a reader and then output the format in FS2004 MDL, FSX MDL, or FSX X format. Unfortunately it is unlikely I have the time to do it myself, but I would be happy to work with others implementing this.
 
#7
If any .NET programmer (preferrable C#) is interested in this, I have some code where it would be trivial to hook up a reader and then output the format in FS2004 MDL, FSX MDL, or FSX X format.
/me raises hand. I love C#. (The language and concept as such, not necessarily all the Microsoft-specific stuff. I abhore Basic in all its forms including VB#.)
 
#9
(not involving paying software like 3DS).
The 3ds format can just be used as an intermediate step for import in GMax if need be...this is how i do it
The result for simple buildings looks encouraging (see attached screenshots). However I had some problems with "Degenerate Polys" error message in xtomdl or faces not showing up. I finally changed all material to doubleface, but I don't know if this is a clean modelling technique. I tried to convert some models from the warehouse, but FSX seems to accept only square textures (the house on the screenshot comes from the library, but I retextured it).
I also get some warnings on degenerate polys....i dont believe this is a 'real' problem, just a side effect of the slighty different approach to modelling that Sketchup uses.

I have found that all faces need to be facing 'outwards' in sketchup in order to show in FS (a reversed face is a purple colour in Sketchup, one facing the user is white). Ive also found problems with faces that arent textured or coloured- these will have no texture mapping on them but will still contain a texture (i.e. on my models where ive used 'un-wrapped' texture sheets in Sketchup, non textured faces contain a stretched/repeated/gobbility gook texture mapping of the texture sheet)

There is an option to export double faces but im not sure if this is then overwritten by GMAX export options?

So to summarise, people will still need a good idea of what they are trying to achieve in sketchup/flightsim in order to make good models....its easier to make a good model in Sketchup but its also easier to make a junk model!

Ill watch this one with interest.
 
#11
Hi Tml

I agree, it is far far easier to use sketchup but, as you mentioned the free google version doesnt allow exporting of other 3D formats....the payware version does allow export of .3ds which can then be imported in Gmax, the textures re-linked, GUID added and then exported as a .mdl for FSX
I am new to modeling and very happy with the almost game-like Sketchup, but I don't know how to re-link the texture...
3dsMax is new for me and I dont wont to learn and understand the whole program for this.
Could U give me a hint or link, I've already googled:laughing:but I had to search a red button in 3dsmax for texturing and even that was to hard:laughing:.

I also would like to thank Lamont for his great Whisplacer.
(the military library doesn't seem to go, FSX crashes(a beta tester:D))

And Timmp I saw youre scenery:eek:, It motivates me to start al over again.

Thx
 
Last edited:
#12
Hi

was wondering if anyone could give me some advice on what programs to use and in what order to use them in. I have photoscenery for the my local airport that i live next to,which is leeds/bradford airport EGNM LBA. I was wanting to add some basic models of high rise buildings ect, placed in the corredt locations. I purchased EZscenery for this and was happy with it until i realised there was very limited global models i could use. I then stumbled upon Google earth SKP/KMZ models and thought theyd be excellent to combine with my scenery if i could convert them. Im new to making/converting models ect. I know very little. I managed to convert the KMZ models to MDL/aircraft format using modelconverterx and then using librarycreatorXML to create the bgl/xml files ext. then i finish off using ezscenery libary to use them in EZscenery. All this seemed to work, except they dont show up in ezscenery. I get a warning saying these arnt fs9 models. Like i said,i have no experience in model or scenery design. The programs i have at hand are GMAX EZSCENERY GoogleSketch 6 pro. libarycreator xml. Easy xml/bgl creator Runway12. model convertorx. And dsont mind getting whats needed. I've trawled through tons of info on the net to no avail. Can anyone please help ?
 
#13
Hi

was wondering if anyone could give me some advice on what programs to use and in what order to use them in. I have photoscenery for the my local airport that i live next to,which is leeds/bradford airport EGNM LBA. I was wanting to add some basic models of high rise buildings ect, placed in the corredt locations. I purchased EZscenery for this and was happy with it until i realised there was very limited global models i could use. I then stumbled upon Google earth SKP/KMZ models and thought theyd be excellent to combine with my scenery if i could convert them. Im new to making/converting models ect. I know very little. I managed to convert the KMZ models to MDL/aircraft format using modelconverterx and then using librarycreatorXML to create the bgl/xml files ext. then i finish off using ezscenery libary to use them in EZscenery. All this seemed to work, except they dont show up in ezscenery. I get a warning saying these arnt fs9 models. Like i said,i have no experience in model or scenery design. The programs i have at hand are GMAX EZSCENERY GoogleSketch 6 pro. libarycreator xml. Easy xml/bgl creator Runway12. model convertorx. And dsont mind getting whats needed. I've trawled through tons of info on the net to no avail. Can anyone please help ? Also id like to point out that google sketchup only exports in kmz and skp i think,but the pro version exports to popular formats like 3ds and obj. But havnt exported anything from sketchup because modelconverterx imports KMZ files.
 
#14
GSU exports as dae (collada) files as well and MCX can read dae files as well. Maybe there is still a bug in MCX as far as KMZ files are concerned. Try a dae export from GSU and then open it with MCX and just maybe that fixes the problem?
 
#15
I've used ModelConverteX to take downloaded Google Earth models, convert them into FSX compatible mdls with XML files, and then placed them into FSX manually myself.

Works perfectly, see the support forum on this site.
 
#16
Hi all
I’m interested in converting google SketchUp’s file to MDL too. I took two different models and tried to convert it by using different ways.
Way 1: Open the SketchUp File exports it to Google Eearch file, using ModelConverterX to import it. This doesn’t seem to work because the 3D preview is wrong. I did also a placement but it doesn’t work.
Way 2: Export it to a dae file and using the Collade2X tool. At the stage of compiling the following exception occurs:
Code:
 Exported .X file
OutputFile: pylon.MDL
Output file after modification: pylon.MDL
Creating output MDL file: pylon.MDL
CRASHTREE no granularity specified
(0): error : XToMdl.exe Unhandled Application Exception
(0): error : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
(0): error : Parameter name: index
(0): error :    at System.Collections.ArrayList.get_Item(Int32 index)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.LODBuckets.GetHighestGranularityBucket()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.ModelProcessingContext.BuildCrashTree()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.ModelProcessingContext.Optimize()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.<GetFileProcessor>d__0.MoveNext()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.FileExporter.OutputModels(IEnumerable ProcessedModels)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.OutputModels(IEnumerable`1 processedModels)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.ProcessAllFiles()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
(0): error : 
(0): error : Index was out of range. Must be non-negative and less than the size of the collection.
(0): error : Parameter name: index
(0): error : 
(0): error : Stack Trace:
(0): error :    at System.Collections.ArrayList.get_Item(Int32 index)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.LODBuckets.GetHighestGranularityBucket()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.ModelProcessingContext.BuildCrashTree()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.ModelProcessingContext.Optimize()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.<GetFileProcessor>d__0.MoveNext()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.FileExporter.OutputModels(IEnumerable ProcessedModels)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.OutputModels(IEnumerable`1 processedModels)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.ProcessAllFiles()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
XToMDL exited with code -1
File does not exists
Way 3: Using the dae for ModelConverterX – same problem than in 1


Thanks for your help.
 
#17
Presuming you use FSX, do you have the latest MCX build? Not the stable but the development release?(I Have not had anymore trouble with importing collada files).
Just wondering: your path to the XtoMDL is set correctly?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#18
Hi,

Way 1: Open the SketchUp File exports it to Google Eearch file, using ModelConverterX to import it. This doesn’t seem to work because the 3D preview is wrong. I did also a placement but it doesn’t work.
The fact that the preview looks wrong seems to indicate that something went wrong during importing. If you did not use the development release of ModelConverterX you might want to try it to see if it works better.

Else, please send me the file you used so that I can try to debug ModelConverterX and find out why it does not import correctly.
 
Top