![Image](https://www.zmodeler3.com/shared/images/20180209/gta5_cloth_buffalo2_01.jpg)
ZModeler3 got an update featuring cloth-simulated meshes export for GTA5. The simulated cloth will response to host object movement and in-game wind.
Cloth geometry can use any shader and have to be named as .cloth in hierarchy. High-detailed geometry model (e.g. buffalo2_hi.yft with highest LOD) can be exported with no cloth, as game reads cloth mesh from main model file with default LODs (buffalo2.yft with L1, L2, L3)
![Image](https://www.zmodeler3.com/shared/images/20180209/gta5_cloth_buffalo2_02.jpg)
Limitations.
- To the moment (ZModeler build 3.2.0.1178, GTARage.zmf build 3.2.0.337) the following limitations apply:
- Only .YFT file can contain cloth mesh. Ped models (.YDD) can not be exported with cloth meshes.
- Cloth mesh can be attached to the main/first hierarchy entry. In case of vehicles, this is always a chassis object.
- Only one .cloth object is allowed in scene (even thought file format assumes multiple cloth meshes support, game rejects such a file.
- Non-collideable cloths are exported (cloth will not interact with player or any scene objects). Collide-able cloth meshes are available in game and under research.
- Model with cloth meshes can not contain embedded textures (see remark below on exporting embedded textures in high lod model).
Cloth meshes are still under research, but in order to let you export them right away, some unknown properties are left to be edited manually via user-defined options.
- User-defined options set on .cloth object are:
- Options - bit flags togging some features on/off. Can combine (comma-separated) values from 1 to 32. Default: 2.
- Unk - two unknown value, the first one most likely to be in range -0.5 to +0.5, and the second is mostly -1.
- Stiffness, Response and Elasticity are comma-separated values defining per-vertex level values. The purpose is guessed, you can suggest your own meaning for these options if you find something with trial and error. Value like 0.0001, 0.003, 0.009 assumes the first "Level" is 0.0001, the second "Level" is 0.003 and the third level is 0.009. Up to six levels can be used currently (see vertex options below). "Stiffness" is optional, some .cloth models have no it.
- Options set on vertices of .cloth object are available in Properties->GTA5->Options window:
- Static point - point is attached to some object. Cloth need at least one vertex to be static to hang on, or entire cloth will fall through the ground immediately.
- Point stiffness, Point response and Point elasticity are Level selectors. Actual level values are set as user-defined properties of the .cloth object itself. Thus, you can assign levels onto cloth vertices and adjust level values on export with trial and error approach.
When an exported model contain cloth-simulated mesh, the file is not allowed to store embedded textures. At least this applies to a .YFT file featuring combination of regular meshes and cloth meshes (e.g. vehicle model). On the other hand, it is known (and was proved by tests) the game does not need cloth object inside high-detailed model file (e.g. buffalo2_hi.yft can be exported with no cloth). Taking advantage of this game behavior, you can use embedded textures on high-detailed model if needed. However, ZModeler will not export embedded texture unless it is used by some material on an object that is being exported currently. Thus, for example, you can't embed cloth texture unless you export the geometry that uses cloth material. To bypass this problem, you can do the following:
1. Assign textures you like to a proper texture container, the regular way of specifying textures as embedded.
2. Remove L0 compound state from .cloth object using "Del" button on the right of "Convert to compound" in structure panel and having "L0" selected in a list earlier.
3. The removed L0 cloth will get detached as child of compound .cloth object (just delete it).
The compound cloth object should show L1 state in a list.