Anim8or Community

General Category => ASL Scripts => Topic started by: Frozenwounds on March 15, 2009, 06:02:04 pm

Title: Custom Export Script
Post by: Frozenwounds 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.
Title: Re: Custom Export Script
Post by: Raxx 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 ;)