Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: Custom Export Script  (Read 2224 times)

Frozenwounds

  • Newbie
  • *
  • Posts: 3
    • View Profile
Custom Export Script
« on: March 15, 2009, 06:02:04 pm »

I've made up my own format for the models in a game I'm making.
I'd like to use Anim8or to make models and I'm pretty sure it's possible to make a script to export to my format. Can anybody make such a script or at least give me some pointers on how to do so?

The format is like this:
Code: [Select]
1,1,1,
1,1,1,
1,1,
The above code defines one vertex.
First line: position relative to origin.
Second line: normal.
Third line: texture co-ordinates.
The format is a triangle list so there should be three of those for each triangle in the model.
There can be spaces (empty lines) between each vertex but not between the three lines.
Each number is allowed to be positive or negative and can be a decimal.
All of the commas are necessary.

I have quite a bit of programming experience but I'm not sure how to work with Anim8or so thanks to anybody who can help or even make the script for me.

Frozenwounds.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Custom Export Script
« Reply #1 on: March 15, 2009, 07:23:50 pm »

Easiest way I learned it was to take a look at the ASL specifications: http://www.anim8or.com/scripts/spec/Anim8or_Scripting_Language.html and look at the export obj plugin made by Steve: http://www.anim8or.com/scripts/export_obj_plugin.a8s

Then I'd just break down the export obj plugin and use it as a reference for building any basic export script. Since you have a bit of programming experience, this should be a piece of cake ;)
Logged