Blendy Blendy Exporter v0.7 Beta Release 1 - PRIVATE USE ONLY
-------------------------------------------------------------
by Pablo Roldn (the_WOZ / =durandal=) pdroldan@gmail.com

April 21st, 2013

Blendy Blendy Exporter is an IL-2 MSH/HIM export script for Blender 2.49 (it will not work on newer versions)

Features:

- Single click msh and him export.
- LOD Support
- Shadow Support
- Hook Support
- Hidden Meshes Support
- Collision boxes Support
- Detachable Meshes Support
- NULL Material Support

What is missing:

- .mat export
- User selectable LOD ranges
- User selectable or auto calculated visibility sphere
- Port to newer version of Blender


Instalation:

Copy the file bbexporter.py to your script directory (In WinXP is Documents and Settings\Your User\Program Data\Blender Foundation\Blender\.blender\scripts)
Run Blender, if correctly installed it should be available in the menu File->Export as "Blendy Blendy Exporter".
If it doesn't show in the menu, open the scripts window in Blender and choose "Update Menus" in the menu Scripts.

------------------------------------

Usage:

Select the mesh you want to be the root of your model (usualy your CF_D0 mesh), select Blendy Blendy Exporter on your Export menu.
A file browser will appear, select the folder where you want the model to be saved to and click 'Export'.
All selected mesh and all its children will be exported as msh files, also a hier.him file will be created with the correct hierarchy.
Existing files will be overwrited without warning.
A different name can be choosed for the hier.him file at the file browser window.

Meshes will be triangulated if needed before exporting, also if no UV map is associated a dummy map will be created.

------------------------------------

Mesh name conventions:

Normal and damaged meshes:
Names are as usual, ie: CF_D0 for normal undamaged mesh, CF_D1 for first damage stage and so on.
The script doesn't check for any _Dx suffix, so in practice normal meshes don't need them for correct export (but the game engine do need the damage stage suffix)

Shadow meshes:
A shadow mesh should be inmediate child to the mesh it is intented for. It's name must end with '-sh'
ie:
 Shadow for CF_D0 must be named CF_D0-sh

Collision boxes:
External collision boxes name must start with a single lowercase 'x' and be parented directly to the intended visible mesh.
Internal collision boxes name must start with 'xx' and also be parented directly to the intended visible mesh.

ie:
Main collision box for Engine1_D0 will be named xengine1 and it's parent must be Engine1_D0
Internal engine crankcase collision box will be named xxeng1cas and it's parent must also be Engine1_D0

Hooks:
Hooks names are prefixed with a single underscore '_'. The actual mesh can be anything, only the pivot point and orientation will be exported
ie:
Left wintip hook name must be _WinTipL and be parented to WingLOut_D0

LODs:
Level Of Detail meshes names must end in '-xy' where x can be anything and y must be a digit from 1 to 9, indicating the LOD number they belong to. All LODs must be direct childs from the main (LOD0) mesh they represent.
ie:

LOD1 for CF_D0 must be named CF_D0-01

(Note, LOD export has not been tested in game yet)

LOD distances in this version are calculated from a single fixed value of 75 by the following funcion:

LOD distance = int(75*((LODnumber*1.5)+1))

------------------------------------

Materials:

Currently materials are not exported, for your model to work in game you need to provide the correct .mat files.
If any mesh have no material associated with it a new material named "BLENDYMAT' will be created.

NULL Material:
Faces associated to a material named 'NULL' will be excluded from the export process. This will correctly replicate the intented vertex normal blending between neighboring meshes.

-------------------------------------

Hidden and Separable meshes:

This two properties can be set in the Object(F7) panel in Blender.
Selecting DrawType as Wire will set the Hidden property for that mesh.
Setting TexSpace in the Draw Extra buttons will set that mesh as separable.

-------------------------------------