Difference between revisions of "Cas Files"
Line 17: | Line 17: | ||
essentially a flexi model but has a small number of weighted vertices, such as Will's high-detail carthaginian infantryman with the weighted shoulder verts | essentially a flexi model but has a small number of weighted vertices, such as Will's high-detail carthaginian infantryman with the weighted shoulder verts | ||
+ | The format of sections that have the multi-bone weighting is different from the normal weapon/body mesh chunks and there do seem to be restrictions on how much they can be used. | ||
− | + | ====Limitations==== | |
+ | Testing the limits of this has only recently become possible, as wilddog's IWTE tool is being tested on writing .dae (Blender) files to .cas for RTW units and will handle the multi-weighting. | ||
+ | |||
+ | The number of verts/tris that can be included in these sections seems limited, exceeding 100 verts/tris per group or 200 verts/tris per case can crash the game or create visual effects similar to having unweighted bones. | ||
+ | |||
+ | The weighting only works between parent and direct child bones, so Torso/Rupperarm works, Torso/Relbow doesn't. RThigh/LThigh combination on a vert will not work, but you can have Pelvis/RThigh and Pelvis/LThigh assigned verts in the same triangle. | ||
+ | |||
+ | The multi-weighted sections form separate chunks or groups within the .cas file, so you will have one 'body' that has just one bone per vert, then perhaps a 'body' with multi-weighting between Pelvis/Abs and another section again called 'body' with multi-weighting between Torso/Upperarms. |
Revision as of 09:47, 28 March 2021
.cas files are used for unit models and animations in RTW, unit animations in M2TW and strat map models and animations in both games. Cas is a proprietary format used by CA to export 3d models and animations from 3dsMax. Various modding tools exist to convert .cas files to either 3dsMax, Milkshape or Blender.
Format Types
The contents and structure of .cas files vary with use (with or without animation, with or without 'mesh') and according to when they were created. Uncompressed .cas files supplied with the games start with a version number, these numbers range from approx 2.1+ to 3.22, the version number can indicate changes to the format. 'Cas' files that are generated by 'unpacking' the animation packs do not return to the same format and do not have a version number.
Bone Weighting
Most .cas models with a skeleton only contain weighting to one bone per vertex, so each vertex will be 100% weighted to a particular bone, triangles that have vertexes weighted to different bones will stretch and contract as the bones are moved in an animation.
Mesh sections for primary and secondary weapons in RTW battle units will be weighted to one bone only, e.g. the right hand, in these type of mesh sections the bone number is given once at the top of the section and not repeated for each vertex.
Mesh sections for the body will typically have vertexes weighted to all of the available bones, but only one bone per vertex as described above.
Multi Bone Weighting
A few vanilla RTW unit models actually have elements where vertexes have shared weighting across two bones. Typically these are the shoulder pad elements as used on the officer_roman_centurion model. The early .cas to 3dsMax converters do not handle these multi-weighted sections and simply fail to import them into Max. For these models to work properly in game they need to have the model_flexi_m setting and not just model_flexi. Model_flexi_m is described in both games descr_model_strat.txt file as:
essentially a flexi model but has a small number of weighted vertices, such as Will's high-detail carthaginian infantryman with the weighted shoulder verts
The format of sections that have the multi-bone weighting is different from the normal weapon/body mesh chunks and there do seem to be restrictions on how much they can be used.
Limitations
Testing the limits of this has only recently become possible, as wilddog's IWTE tool is being tested on writing .dae (Blender) files to .cas for RTW units and will handle the multi-weighting.
The number of verts/tris that can be included in these sections seems limited, exceeding 100 verts/tris per group or 200 verts/tris per case can crash the game or create visual effects similar to having unweighted bones.
The weighting only works between parent and direct child bones, so Torso/Rupperarm works, Torso/Relbow doesn't. RThigh/LThigh combination on a vert will not work, but you can have Pelvis/RThigh and Pelvis/LThigh assigned verts in the same triangle.
The multi-weighted sections form separate chunks or groups within the .cas file, so you will have one 'body' that has just one bone per vert, then perhaps a 'body' with multi-weighting between Pelvis/Abs and another section again called 'body' with multi-weighting between Torso/Upperarms.