IModelWriterCmh
Description
- Derived from
Represents the background operation that writes a 3D model file using the ModelFormat.CMH format.
The following file format versions may be used for VersionMaximum and VersionMinimum:
-
File Format Version
7
RELEASE - V1.0 RC4.31 - 2025/09/16
https://manual.tinman3d.com/STABLE-PREVIEW/changelog.html-
An optimized binary file layout is used, where the initial load operation (see Model.Load1) accesses only the
CMH
file header and a small contiguous range at the end (in contrast to a number of scattered reads in earlier format versions). Subsequent lazy-loading is only performed for calls to IModelGeometry.ReadVertices, IModelGeometry.ReadIndices and IModelTexture.ReadTexels. -
To further avoid lazy-loading, the ModelFlags.ComplexHierarchy flag can be added to ModelFlagsOr. Then all models in the hierarchy will have precomputed spatial bounds (see IModel.Bounds). The ModelFlags.ComplexGeometry flag can be used analogously, to include precomputed spatial acceleration structures (see IModel.Collider).
-
This format version does not define any new model features, so it will never be used automatically (see below for details on how file format versions are chosen). Because of this, existing code still produces the same binary output. To use the optimized layout, set VersionMinimum to
7
.
-
-
File Format Version
6
RELEASE - V1.0 RC4.27 - 2024/10/31
https://manual.tinman3d.com/STABLE-PREVIEW/changelog.html#_20241031-
Pre-computed ISpatialBounds data may be embedded in the model file, see ModelFlags.ComplexHierarchy.
-
-
File Format Version
5
RELEASE - V1.0 RC4.6 - 2023/03/07
https://manual.tinman3d.com/STABLE-PREVIEW/changelog.html#_20230307-
The following material properties may have non-default values:
IMaterial.LineThickness, IMaterial.Refraction. -
The following material part properties may have non-default values:
IMaterialPartBase.Channel, IMaterialPartBase.Flags. -
The following material parts may have non-default values for IMaterialPartBase.Map:
IMaterial.Metalness, IMaterial.Roughness, IMaterial.Specularity, IMaterial.Transmission. -
The following material parts may have non-default values for IMaterialPart.Value:
IMaterial.Metalness, IMaterial.Normal, IMaterial.Occlusion, IMaterial.Opacity, IMaterial.Roughness, IMaterial.Specularity, IMaterial.Transmission. -
The following material part ColorF values may have HDR values, see ColorF.IsHdr:
IMaterial.BaseColor, IMaterial.Emissive, IMaterial.Reflectivity, IMaterial.Translucency. -
Vertex data may include a second texture coordinate set, see ModelVertexFormat.TextureCoordsExtra.
-
The ModelPartFlags.NoLighting may be applied to arbitrary IModelPart objects of a IModel object, instead to all or none of them.
-
The PrimitiveBatch.Zero value of IModelPart.Batch may be greater than zero.
-
A IModelPart object may be used by many IModel objects.
-
-
File Format Version
4
RELEASE - V1.0 RC4.5 - 2023/02/10
https://manual.tinman3d.com/STABLE-PREVIEW/changelog.html#_20230210-
IModel objects may have non-default values for IModel.FadeIn and IModel.FadeOut.
-
IModelPart objects may have a non-default value for IModelPart.Layer.
-
-
File Format Version
3
RELEASE - V1.0 RC4 - 2021/09/10
https://manual.tinman3d.com/STABLE-PREVIEW/changelog.html#_20210910-
Pre-computed IModelCollider data may be embedded in the model file, see ModelFlags.ComplexGeometry.
-
-
File Format Version
2
RELEASE - V1.0 RC4 - 2021/01/10
https://manual.tinman3d.com/STABLE-PREVIEW/changelog.html#_20210110-
A IModel may contain two or more IModelPart objects, see IModel.PartCount.
-
Child-to-parent transformations may have 64-bit floating-point precision, see AffineTransform.
-
Vertex positions may have 64-bit floating-point precision, see ModelVertexFormat.PositionExtra.
-
-
File Format Version
1
RELEASE - V1.0 RC4 - 2019/04/01
https://manual.tinman3d.com/STABLE-PREVIEW/changelog.html#_20190401
The model writer chooses the lowest file format version between VersionMinimum and VersionMaximum that is capable of encoding the given IModel object. If the required file format version is not included in the allowed range, a ValidatingException will be thrown when the operation is run. To catch validation errors up-front, use the IValidatable.Validate method. The ModelFlagsAnd and ModelFlagsOr properties can be used to modify the IModel.Flags value of the input model (including its descendants). First, the intersection of the model flags of the input model (see IModel.Flags) and the flags of ModelFlagsAnd is computed. Then, the union of the resulting flags and ModelFlagsOr is computed. The final flags are used to write the CMH model file, while the original IModel.Flags values are preserved.
Public / Attributes
ModelFlagsAnd
Controls the IModel.Flags values of the written model.
Defaults to ModelFlags.All, i.e. all model flags are retained.
ModelFlagsOr
Controls the IModel.Flags values of the written model.
Defaults to ModelFlags.None, i.e. no model flags are added.
VersionMaximum
The maximum file format version to use for writing the model file.
Defaults to Maths.MaxInt.