Export as mdl fails, export as .x file OK

#1
Hi again Arno!

A frustrating problem with a model using both the latest development release and an older 'it always works' version;

My latest revision of an older model imports fine into MCX (using .jpg textures), but will not export as .mdl, or .bgl. I get a zero bit file as the result. It will however export as a .x file, and that file can be imported successfully back into MCX. It just will not export as .mdl or bgl.

The model is more complex now, but it's not the most complex one I've done. Twenty plus draw calls and 18,000 vertices.

I tried hiding parts of the model bit in Sketchup, then exporting with 'export hidden geometry' unchecked. When I finally had most all the model hidden I got a successful .mdl export, however even a very simple hull structure would not export.

As a check, another more complex model exported fine with the latest development release. And the original of this model exported properly.

I'm not sure what to try next! It seems like it must be something with the model, but I've checked everything I can think of! :)

Any suggestions from you or others will be immensely appreciated. :)

Larry



Here's an error log from one text where I successfully imported a .x file having successfully exported it from the Sketchup generated .dae file.

4:10 PM XReader Information Starting reading of file C:\Users\Larry\Desktop\temp textures\hiyu test as x.x
4:10 PM XReader Information Finished reading objects
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_3.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_side_30.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_hiyu_top.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_inner_side.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_end_37.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_2.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_tunnel_sides.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_0.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_1.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_railing.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_radar_base.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_crane_and_boat.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_life_raft2.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_cables1_28.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_ferry_horn.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_antenna.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_side_34.dds
4:10 PM ObjectRenderer Information Loaded texture: C:\Users\Larry\Desktop\temp textures\hiyu test_life_ring1.dds
4:10 PM MDLXWriter Information Starting writing of file C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
4:10 PM MDLXReader Information Starting reading of file C:\Users\Larry\Desktop\temp textures\hiyu test.mdl
4:10 PM MDLXReader Information Finished reading objects
4:10 PM XWriter Information Starting writing of file C:\Users\Larry\Desktop\temp textures\hiyu test.x
4:10 PM XWriter Information Finished writing of file C:\Users\Larry\Desktop\temp textures\hiyu test.x
4:10 PM XtoMDL Information OutputFile: C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
4:10 PM XtoMDL Information Output file after modification: C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
4:10 PM XtoMDL Information Creating output MDL file: C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
4:10 PM XtoMDL Information error : Error loading .X file: (C:\Users\Larry\Desktop\temp textures\hiyu test.x). Is it a valid FLIGHT SIMULATOR '.X' file?
4:10 PM XtoMDL Information (0): error : XToMdl.exe Unhandled Application Exception
4:10 PM XtoMDL Information (0): error : Error in the application.
4:10 PM XtoMDL Information (0): error : -2005531760 (Unknown)
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
4:10 PM XtoMDL Information (0): error :
4:10 PM XtoMDL Information (0): error : Error in the application.
4:10 PM XtoMDL Information (0): error :
4:10 PM XtoMDL Information (0): error : Stack Trace:
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
4:10 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
4:10 PM MDLXWriter Information Finished writing of file C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
 

n4gix

Resource contributor
#2
The very first error indicates that the .x file isn't a valid FSX format:
Code:
Error loading .X file: (C:\Users\Larry\Desktop\temp textures\hiyu test.x). Is it a valid FLIGHT SIMULATOR '.X' file?
 

tgibson

Resource contributor
#3
Can you have spaces in the X file name? It's best to avoid them in the FS2004 compile process, and perhaps FSX is similar.
 
#4
The very first error indicates that the .x file isn't a valid FSX format:
Code:
Error loading .X file: (C:\Users\Larry\Desktop\temp textures\hiyu test.x). Is it a valid FLIGHT SIMULATOR '.X' file?
Thanks folks,

I normally do not use spaces in the file names, but to check, I just tried exporting an older model with and without spaces in the filename. Both exports worked.

I then used MCX to export that older model as a .x file (e.g. boat.x). I imported that file back into MCX, and successfully exported it as a .mdl file. In the past, if I’m watching my export file folder during export, MCX first generates a .x file (or appears to), which then disappears as the desired file format is created. So I’m not sure about the significance of the error message regarding .x files not being an fsx file. Interestingly, in the MCX file export file type drop down box, .x files are listed as “FSX object X file” or something like that.

Edited to add an part of an error log from a test of exporting the 'bad' model from MCX as a .mdl file:

3:20 PM MDLXWriter Information Starting writing of file C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
3:20 PM XWriter Information Starting writing of file C:\Users\Larry\Desktop\temp textures\hiyu test.x
3:20 PM XWriter Information Finished writing of file C:\Users\Larry\Desktop\temp textures\hiyu test.x
3:20 PM XtoMDL Information OutputFile: C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
3:20 PM XtoMDL Information Output file after modification: C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
3:20 PM XtoMDL Information Creating output MDL file: C:\Users\Larry\Desktop\temp textures\hiyu test.MDL
3:20 PM XtoMDL Information error : Error loading .X file: (C:\Users\Larry\Desktop\temp textures\hiyu test.x). Is it a valid FLIGHT SIMULATOR '.X' file?
3:20 PM XtoMDL Information (0): error : XToMdl.exe Unhandled Application Exception
3:20 PM XtoMDL Information (0): error : Error in the application.
3:20 PM XtoMDL Information (0): error : -2005531760 (Unknown)
3:20 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
3:20 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
3:20 PM XtoMDL Information (0): error : at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
3:20 PM XtoMDL
etc
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#5
Hi,

Something in the x file is wrong, but most likely it is not your problem. Most of the times it is a bug in modelconverterx that causes this.

Can you send me one of the models that gives this problem? Then I can try to reproduce it.
 
#6
Hi,

Something in the x file is wrong, but most likely it is not your problem. Most of the times it is a bug in modelconverterx that causes this.

Can you send me one of the models that gives this problem? Then I can try to reproduce it.
Hi Arno,

Thank you *so* much! This was driving me crazy, trying to figure out just why only this model was causing problems. :)

When I get home I'll send you the model in question with .jpg textures which will not export, and if it's not too large I'll separately send the same one with .psd textures that will not load into MCX properly.

Larry
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#8
Hi Larry,

I have found and fixed the problem. So the next development release should work (will be available in about 1 hour from now).

The problem was that SketchUp exported some texture coordinates as NaN (not a number) and XtoMDL does not like that.
 
#9
Hi Larry,

I have found and fixed the problem. So the next development release should work (will be available in about 1 hour from now).

The problem was that SketchUp exported some texture coordinates as NaN (not a number) and XtoMDL does not like that.
Thanks so much Arno! Wonderful news and thanks for your work on such an abscure problem. I wonder what the offending texture or part of the model was causing the problem.

Larry
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#10
It's hard to see in the collada file which part of the model it was. I didn't expect sketchup would generate NaN values, so in that case it is always good to make the tool more robust.
 
Top