Anim8or
Home Site home Derivable balls Derivable cushion Other derivables Force update Seat trigger Transparency File formats Anim8or Pose editor Clean up tool Template tool XRF tool Ball  generator Removing seats Quick Icons Contents

 

Anim8or mesh export script

Anim8or is a freeware OpenGL based 3D modeling and animation program by R. Steven Glanville.

It is available at www.anim8or.com. As of January 2010 I am using version 0.95, though there is a newer version in "beta" it is not recommended for beginners.

It has a script API to allow users to extend it with plugins written in a C-like language.

The export script is an adaptation of an example script, the original script would convert an object into "C" language form, possibly for use in a game.

My version adds the following:

Output a crude form of IMVU XMF.
Fix the U-V map coordinates (flip vertically)
Convert coordinate system e.g. rotate 90 degrees around X axis (in Anim8or "Y" is "up" and "Z" is towards screen, in IMVU "Z" is "up" and "Y" is "away"
Add a scale factor currently 100 (anim8or objects may be scaled to sizes below 10 whereas  1000 is a good start in IMVU).

My script suffers from some severe limitations:

Currently it will only support a single material, hardcoded to 0
If the mesh has multiple parts then the vertex count will be massively wrong, stick to simple meshes
If the mesh has a skeleton it will be recognised but not exported instead a comment will be output
The mesh file contains a lot of diagnostic comments. A small number of older IMVU versions may fail to render meshes with comments, though as of 420 this bug appears fixed, also as far as I'm aware the "standard graphics" renderer was never affected.

Script Installation

Anim8or configuration screen

Anim8or configuration screen

The easiest way to install the script is to drop the script into the same folder as the program. In anim8or you must set up a script folder and enable preloading. The script folder can be set to "." meaning it is the program folder. If you do this correctly then the exporter will be preloaded and added to the Object Exporter list.

Script file (zipped)

Fiddling with the script:

/* How much do we multiply coords by */
$scaleadj=100;
/* Bone to weight mesh to (should be >0 on a finished product)*/
/* setting to zero causes "XSF" file to be mostly ignored */
$imvubone=0;
/* Offset to add in IMVU space (probably not needed) */
$xadj=0;
$yadj=0;
$zadj=0;
/* do we apply transformation matrix? */
$projtrans=1;

The $imvubone option sets what bone (influence ID) to use. By setting it to zero it is set to the parent node of the product, largely ignoring the XSF file. This is a quick dodge to get the product imported but should be replaced with a proper bone number when making a serious product. Note if you need to change the script you'll need to reload anim8or.

The exporter is discussed in the forum here

A sample mesh in "obj" form was obtained from Falling Pixel Designs

UVmapper

At this point I should mention UVmapper Classic 0.30a, available at www.uvmapper.com. Anim8or does not give you much control over texture map coordinates. Lathe solids get a simple cylinder mapping by default but the built in UV tool does odd things. UVmapper provides more powerful tools for unwrapping an object into a flat UV map. To use it you export your object as ".obj" format, load it into UVmapper, then re-export it as .obj and import back into anim8or. You can also create a bitmap texture map template.

Serious developers probably should give the pro version a look as the 3D preview will take away a lot of guesswork. I'm sticking with the free "classic" for now.