Applying ModelDef.xml to the model

#1
Hello!

I opened the model and edited the modeldef.xml code for some gauges, but it looks when I saved the model the new code was not applied.
When I choose "Save..." in the ModelDef.xml dialog, it offers to save it as a separate file. So how do I apply an edited modeldef.xml to a model?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi,

When you export to a MDL file, MCX will save the modeldef.xml that it has internally and use it to compile the MDL file.

But what kind of changes did you make in the file? Unless the changes break some of the animations, they should be kept when exporting.
 
#3
When you export to a MDL file, MCX will save the modeldef.xml that it has internally
Do you mean the one specified in the ModelDefPath in the Options?

But what kind of changes did you make in the file? Unless the changes break some of the animations, they should be kept when exporting.
Just changed some A: variables to L: variables so I could add custom logic to the gauges.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
Do you mean the one specified in the ModelDefPath in the Options?
No, when you load the model MCX will load the modeldef.xml from the path in the options. If you make modifications those are kept in memory. When you export the in memory version is written to a temp file on disk and used for the compile. Afterwards it is removed again. So the file specified in the options is not changed or so.

Just changed some A: variables to L: variables so I could add custom logic to the gauges.
OK, I think that should not be a problem.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#5
Hi,

I just tried to make some changes in the modeldef.xml editor myself, but it seems they are not always kept when saving indeed. I'll need to debug a bit deeper, I'll have a look at that tomorrow.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#6
Hi,

You found a nice bug, it was hidden quite well. It would only happen when you try to overwrite an existing MDL file and the preserve guid option is on (which is the default value).

I have fixed the bug now, it will be in the next development release that should be online in about 15 minutes or so.
 
Top