IWTE - Units in Blender/Milkshape
Tips and instructions for working with M2TW battle map units via IWTE and Blender using the .dae format - December 2020 version onwards.
The .dae files used for the Collada import/export can also be used with 3ds Max, however, max users absolutely have to use the OpenCollada plugin and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.
Export and Import
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. This can be done via the drop-down menu in IWTE or by the IWTE Task file system. A task file is recommended for complex combinations and is the only way to also incorporate weapon animations.
The button location is shown below:
Select the double mesh option for unit meshes that have both a main and attachment texture. Select the single mesh option for most other cases (e.g. standard mounts). You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton, and then optionally any number of animation.cas files that are compatible with that skeleton. Press cancel when you have loaded all the animations you want to view in the one file.
Export/Import by Task Process
To generate a .dae file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command. See example below:
<task_id> mesh_to_dae
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh
<mesh_double_texture> yes
<cas_file_types_in_list> body weapon
<cas_file_full_path_in_default_list>
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas
<cas_file_full_path_in_action_list>
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger
<dae_file_name_out> EBslingerAnims.dae
<create_text_file> yes
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. (the code is hard to display well on wiki!)
Running the task will generate you a .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing.