armory3d / armortools

3D Content Creation Tools
https://armorpaint.org
Other
3.16k stars 333 forks source link

Guidelines on parsing new object format. #1056

Closed todirbg closed 2 years ago

todirbg commented 2 years ago

Hi Lubos, I want to add support for X-Plane obj8 format to Armor Paint and I want to ask you for some guidelines to conform to your code. I have some code working, just to confirm reading the file and extracting the relevant data for the moment. I see from your wavefront obj importer that you are parsing the file as a binary byte by byte. X-Plane objs are guaranteed to be ASCII text and are much easier to parse as strings. For now I am using BytesInput to get the data and read it with .readLine. It is working(on win), but I want to ask if this is OK or I should rewrite the code to read it as your parser does?

luboslenco commented 2 years ago

Hi! If you parse it like ObjParser.hx does it should be faster, otherwise there is not difference - both approaches work. It can also be implemented as a plugin, like import_stl does.