A Shape in the code
Following notes are only a draft and work in progress! — Sit Melai 2016/12/05 19:37
How a shape is optimally created
To fill a shape, you have to fill the CMesh::CMeshBuild (structure explained below). Then you can call build on a CMesh object with your CMesh::CMeshBuild object as parameter. The CMesh object generated from this can be written into a file by opening a COFile stream and calling the serial method on the CMesh with your stream as paremeter.
How it is serialized in the code (using serial())
How CMeshBuild struct looks like
The .shape format
You want to make your own importer/exporter for .shape files? Take a look at the structure of the .shape format.
Not finished yet, missing some parts that can be parsed as PolyPtr! WIP!
— Sit Melai 2016/12/11 16:48
Check Nel Files Documentation for how to serialize each class:
Base class for start is CShapeStream. You need all classes that are called from this class, and following classes (or child classes) for PolyPtr:
- IMeshVertexProgram (CMeshVPWindTree, CMeshVPPerPixelLight)
- IShape (CMesh, CMeshBase, CMeshMRM, CMeshMRMSkinned, CMeshMultiLod)