Bonus: Cloth Physics - Krunklehorn/io-scene-gzrs2 GitHub Wiki
Realspace supports cloth physics on any prop with vertex colors, up to 165 triangles.
Mappers can use this to create things like flags or curtains with extra controls to have them blow in the wind or lay flat across a surface.
- Add a new plane mesh to the scene and subdivide it 8 times. (Ctrl + E -> Subdivide) A 9x9 grid of quads is 162 triangles.
- Change it's type to "Prop" and subtype to "Flag".
- In the "Filename" field, enter: <name of your map>_<name of the object>
- For example: TestMap_Test_Flag
- For flags, this naming convention is strict!
- Scale, rotate, position, unwrap and texture your flag as you please.
- Switch to Vertex Paint mode then open the color attribute selector and delete the default color attribute.
- Add a new color attribute with the following properties...
- Name: Color
- Domain: Vertex
- Data Type: Color
- Color: Black
- Color the top row of vertices red to pin them in place. Leave the rest black.
- If you can't see any vertex color, change the viewport shading mode to "Solid"
- Switch back to Object mode and make sure your flag mesh is the only object selected.
- Open the .elu exporter, set the Filter Mode to "Selected" and enable the "Map Prop" switch.
- Export as "<name of your map>_<name of the object>.elu" to the same directory as your map.
- For example: TestMap_Test_Flag.elu
- Export and test. At this point you should have a basic flag to play with.
- Map export writes extra properties to "flag.xml" for controlling flag movement.
- Wind direction and power behave as expected, but "Random" is the only wind type that works properly.
- Flag objects don't collide with the world, but the limiter can define an axis-aligned field to help that.
- Flags are more interesting when they brush against window shutters or drape onto the floor. Get creative!
Pro Tip: Painting with the brush tools may end up smearing the colors causing vertices to change their behavior. Make use of the Vertex Selection Mask and Set Vertex Colors (Ctrl + X) tools for better control.
Pro Tip: A single .elu can contain multiple flag meshes, but only the one matching the naming convention will be configurable by flag.xml's extra properties. For best results, always make each flag a unique mesh with a unique name.