Banners - M2TW
Battle-map banners in M2TW are stored in mesh format with faction-specific textures applied. Their use is controlled by descr_banners_new.xml, the settings at the start of the file control the wave and bounce effects applied to the banners in-game which give the appearance of animation.
Most of the file is self-explanatory or has explanatory comments.
The Wave section has lines like:
<Wave0 Amplitude="0.7" Speed="7" FrequencyX="-1.0" FrequencyY="0.35"/>
Amplitude affects the extent to which the moving parts move. Frequency also affects the extent of movement in the plane specified. X seems to produce a more left to right movement, whereas Y adds more of a twist where the top areas move left ahead of the lower areas. It is possible to add a Z component but effects seem similar to X.
Movement only ever seems to be along a horizontal plane, the flag components don't move up or down except with the selection 'bounce'.
The mesh files are pathed to data\banners\etc if you want them to be read from a mod folder you will need to change the paths in the .xml file to mods\my_mod\data\banners\etc. Texture files work from the mod-folder as normal.
The MiniMesh banners which are used for experience are hardcoded to shift the uv mapping to provide the 4 variant options. So although you'll see 4 apparently different mini flags of each type in battle they are all based on the same mesh with the uv mapping in the top left quadrant.
Banner Modding with IWTE
IWTE and Blender can be used to export/import banner meshes for modification.
The Import/Export functions are accessed from the top menu drop-down section:
Export converts a mesh to .dae format, import converts a .dae file to mesh.
To use the .dae files in Blender use the Import/Export Collada function.
There's no bone or anim included in the mesh file, the movement is caused by the wave amplitude applied to a value stored against each vertex. IWTE stores the value in the red channel of the vertex colouring. There is also another value per vertex which is stored in the green channel, this does not appear to do anything.
To view the colouring in Blender you need to select the mesh and switch to Vertex Paint mode.
As noted above only the value in the red channel affects the amount of movement of the banner, if you're trying to edit the red values you may find it useful to use green as the base colour instead of black as it makes the variation in the red channel easier to see. You can use a blue component but IWTE won't store that in the mesh file.