Import AGN files

Until now the scenProc tool could only be used to create AGN files. But when you want to enhance or view existing AGN files it is also useful to be able to import them again. That feature has been added to the development release versio now. To illustrate how it works I will explain two use cases where this new step is used.

Enhance existing AGN files

Let’s assyme you have made some autogen files before only containing forest polygons. You used a file like this to create this autogen:

IMPORTOSM|schier.osm|*|*
#
SPLITGRID|AGN
#
CREATEAGNPOLYVEG|FTYPE=POLYGON;landuse=forest|{e8b937fd-a1f2-4bd5-8548-2c80d30102af}
#
WRITEAGNFILES|FSX|c:\flightsim\fsx\myscenery\texture

And now you want to add autogen buildings to the same area as well. Of course you could run the entire process again, adding more rules. But now you could also import the existing autogen and add only the new buildings. This is a configuration file that would do that:

IMPORTOSM|schier.osm|*|*
#
IMPORTAGN|c:\flightsim\fsx\myscenery\texture
#
SETAGNBUILDINGHEIGHT|*|1.0;0.0;0.0;0.0
#
SPLITGRID|AGN|building=*
#
CREATEAGNGENBUILD|FTYPE=POLYGON;building=*;FWIDTH<20|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
CREATEAGNGENBUILD|FTYPE=POLYGON;building=*;FWIDTH>20|{6089A0BD-CED1-4c47-9A9E-64CDD0E16983}
#
WRITEAGNFILES|FSX|c:\flightsim\fsx\myscenery\texture

What happens here is that after loading the source data, you also load the existing AGN files. This means that all autogen defined in there is added to your data cells and when you create additional autogen it will be added to what is already there. So when you export it agian you have the old and the new autogen.

Export AGN files

How scenProc normally works is that you load vector data, this is then stored as internal vector features. Using the different steps you then create autogen objects out of these. In the example above the autogen objects were imported again, but in that case they are not converted to features, they stay as autogen. If you want to export the AGN to shapefiles for example, you would have to convert them back to features. This configuration shows how that can be done:

IMPORTAGN|c:\flightsim\fsx\myscenery\texture|CREATEFEATURES
#
MERGEGRID
#
EXPORTSHP|*|my_agn

The additional CREATEFEATURES option tell the tool to make features again. And these can then be export to SHP. The MERGEGRID step is optional, but what it does is the reverse of the SPLITGRID step, it combines all different cells into one big cell. This means you get one SHP file for the autogen, else you would get a SHP file per tile

Choosing shaders

A new option has been added to ModelConverterX, with this option you can force the preview to use simple shaders. This option has been added because certain graphics cards have performance issues with the more complex shaders that are used by default. By setting the ForceSimpleShader to true the preview is forced to use the simple ones (you need to restart to see the effect).

What does simple shaders mean? It means that the preview will not show the more advanced features like night textures, bump textures or specular textures. Only the diffuse colour and texture will be shown. But that should be enough to view your object at a better performance.

The animation editor became a real editor now

From the next development release the animation editor will have an additional feature, you will now be able to adjust the type of each of the animations. So in a way you can now really edit the animations (as the name of the editor already suggested of course).

Just select the animation you want to change and then select the new animation type you want to use in the combobox. After that you press the button to assign the new animation type. That’s all!

Btw, there was also a bug in the development release of yesterday concerning animations. Due to this bug the animation name was not read correctly for certain animations. This bug has been fixed by now as well.

Animation editor

Animation editor

Improvements for aircraft models

In the next ModelConverterX development release there are two big changes that are mainly important for aircraft modellers:

When a custom animation is used in the FSX MDL file that is not defined in the modeldef.xml file that you pointed ModelConverterX to it will no longer be ignored. Instead ModelConverterX will read the animation parameters from the MDL file and add the right XML code to the modeldef.xml file. It does this all in memory so the modeldef.xml file on your disk is not altered by the tool.

Mouse rectangles and now read from and written to FSX MDL files as well. Just as for the custom animations ModelConverterX will first try to find the mouse rectangle definition in the modeldef.xml file and if it does not find the right one, new XML code is added in memory.

In the Hierarchy viewer you see with mouse rectangle is assigned to which part, just as you can see the visibility conditions.

I tried to test these new features as good as possible, but I am no aircraft designer myself. So I am sure you might come across some animation or mouse rectangle that does not work exactly as expected. In that case please let me know.

One other issue you might come across while examining your VC for mouse rectangles  is that the ModelConverterX preview becomes slow if you load a complex VC model. For the FSX default models it still works fine, but the much more detailed VC models that come with many of payware aircraft will bring the preview down to a slide show. I am investigation where the performance bottleneck is and hope to fix this in an update soon.

Moving around in the preview

p11sTo move around in the ModelConverterX object preview you would use your mouse. With the left button you can rotate the object, with the right button you can pan the object. And with the mouse wheel you can zoom.

And to control how much zoom and pan you give there are two options: PanScale and ZoomScale. These can be changed to determine how much pan and zoom effect moving your mouse gives.

A while ago I also added a sensitive mode. This means that if you keep the S key pressed all rotating, panning and zooming will go with steps that are 10 times smaller than normal.

And from the next development release there is another way to move around in the preview. You can now use the keys on your keyboard as well. With the arrow keys you can move around over the ground plane. With the up key you go forward, with the down key backwards. Left and right obviously move you in those directions. And the page up and page down keys can be used to move up and down respectively.

Hopefully this new navigation mode makes it even easier to move around and inspect your models.

Back online

offlineIt must have been Murphy’s law, just a day after I left home the server on which this website runs went offline. And remote I could not login anymore to correct the problem. So this site has been offline for a couple of days now.

Today I got back home again and after a quick reboot of the server everything seems to be running fine again. Just let me know if you still have any and sorry for the inconvenience.

Recent changes

In the last three weeks I have been a bit busy, so I haven’t posted about the changes I made to my tools recently. Here is a quick overview of the most important changes:

  • There was a memory leak in scenProc when using the SplitGrid step, this has been fixed. But if you still have a version build between the 2nd and 11th of March, I would urge you to update to the latest version.
  • You can now highlight the selected part in the hierarchy viewer in the preview. This can be useful to identify with node of the scenegraph you have selected.
  • There was a bug that objects with empty LOD did not export correctly anymore, that has been fixed now.
  • I have added a new batch operator to apply a material template. This means that you can now apply a certain material template to a selection of objects using the batch convert wizard. Given that applying a night texture is also a material template, the special batch operator to apply a night texture has been removed now.

Visibility tags

I have added a new feature to ModelConverterX, it now also uses the visibility tags that are used often in FSX aircraft models. They are read from either the MDL or the X file. And when exporting to FSX MDL they are written as well. So this should mean that such visibility tags no longer get lost when converting a FSX MDL with ModelConverterX.

At the moment there is no way to edit the visibility tags yet, but in the hierarchy viewer you can see which tag is added to a node. I guess for the future I should add some functionality in the preview that allows users to switch the visibility tags on or off.

Batch convert changes

In the next development release a couple of changes have been made in the batch convert wizard of ModelConverterX. The main changes are:

  • You can now select if you want to save objects or scenery. When you select objects each model in the selected files is saved as a separate file. If you select scenery, one output file will be made for each input file.
  • There are two button to save and load the batch convert settings. This will save the files you have selected to process, the operators and their settings and the output settings. So this should make it easier to run the same or similar batch runs in the future.

I have added some new batch operators as well, this is an overview of them:

  • Add placement: adds a placement (latitude/longitude) to all objects
  • Center object: makes sure the reference point is in the centre of the object. If the object has a placement, this placement is also updated to match the shift of the object.
  • Rename object: renames all objects to the given name, if multiple objects in one file they are extended with a number
  • Rename textures: rename all textures of an object. They are renamed with the object name, followed by a number

I plan to write another blog post soon explaining how I used these new operators, so that it makes more sense why I added them.