Start a new topic

How to determine format "revision" of an OpenFlight file

Original Post by: SteveThompson Mon Jun 3 17:35:05 2013


The following question was moved from another thread to this one...


Original Post by: Tharak Sat Jun 1 10:23:49 2013


Hi Support,


Thanks for your support. How to find out the which version of FLT i created using the presagis libraries? Is there any program to findout FLT version using presgis program. ? If any please give me that program?

Original Post by: SteveThompson Mon Jun 3 18:01:04 2013


There is no program, per se, whose sole job is to determine the OpenFlight revision level corresponding to a particular OpenFlight file. Of course, there is Creator (the Presagis 3D modeling tool) that can show you this information and do very much more with your OpenFlight file.


In addition, there are functions in the OpenFlight API you can use on an open database that can tell you this information. Note that the OpenFlight revision level is an attribute of the OpenFlight database

header node. The attribute code for this is fltHdrFormatRev. You can "get" this value (like you do any attribute value) using mgGetAttList . You cannot "set" this value, it is automatically set when you "save" the database file.


Below is a C language snippet showing you how to get the OpenFlight revision level for an open database db:


int formatRev;

int numAttr = mgGetAttList (db, fltHdrFormatRev, &(formatRev), MG_NULL);

// formatRev will be an integer number encoded like 1640, 1630, 1620, etc

// specifying the OpenFlight format revision of this OpenFlight file.

Original Post by: cjennings Thu Jul 31 15:10:43 2014


You cannot "set" this value, it is automatically set when you "save" the database file.


So there is no way at all to set the revision? So if I needed 16.2 instead of 16.4 this wouldn't be possible?

Original Post by: ChrisRogers Thu Jul 31 15:36:43 2014


This value is set by Creator. You cannot set it directly. If you need a different version, you need to re-save the file as that version. There are a few ways to do this inside of Creator. The easiest way is to use the export option to export to the openflight version you need. If this is a common problem for you, you can set your creator preferences to save out the version you need by default.

Original Post by: ChrisRogers Thu Jul 31 15:40:29 2014


Please remember that the revision is not simply a value in the header. It represents significant changes to the openflight format. This value is used by tools that import openflight so they know how to import the file. If you were to simply change the format without resaving and changing the structure of the file on disk, it could be very detrimental to anyone importing that file.

Original Post by: cjennings Thu Jul 31 15:51:49 2014


Please remember that the revision is not simply a value in the header. It represents significant changes to the openflight format. This value is used by tools that import openflight so they know how to import the file. If you were to simply change the format without resaving and changing the structure of the file on disk, it could be very detrimental to anyone importing that file.


Yes, I am very aware that it represents significant changes, that's actually the reason why I needed it. :)


Nevertheless, using the Export function worked. Thank you!


Cheers!

Original Post by: ChrisRogers Thu Jul 31 15:57:12 2014


that’s actually the reason why I needed it

Just making sure ;)


I'm glad that worked for you.


I believe another customer had a similar problem, but they needed to modify a large number of databases... If you find yourself in this situation, or another customer reading this does, you can use the Batch Run Script tool to do this for you. It allows you to use the save version preference to determine what version of openflight it saves and it allows you to save all the files even if they were not modified. The script need not do any work, the tool will do all the work for you.

Original Post by: SteveThompson Thu Jul 31 16:00:34 2014


And since this is an OpenFlight API forum, you might like to know to "export" the file to a different OpenFlight version without Creator. There is an OpenFlight API function for just this, mgExportDb. The following code snippet would save a database (db) as OpenFlight Format Revision 15.6.


mgExportDb (db, "file15-6.flt", MEFN_OPENFLIGHT, MEFV_1560, MG_NULL);

Original Post by: cjennings Thu Jul 31 16:21:33 2014


And since this is an OpenFlight API forum, you might like to know to "export" the file to a different OpenFlight version without Creator. There is an OpenFlight API function for just this, mgExportDb. The following code snippet would save a database (db) as OpenFlight Format Revision 15.6.


mgExportDb (db, "file15-6.flt", MEFN_OPENFLIGHT, MEFV_1560, MG_NULL);


This is actually exactly what I used ;)


I was able to put 2 and 2 together when he mentioned the Export in Creator.


Thank you as well!

Login to post a comment