Add example and description for keys

This commit is contained in:
Epicalert 2021-03-09 23:10:16 +08:00
parent bd69bfea16
commit 10f36ef3fb
No known key found for this signature in database
GPG key ID: CAA46F858D0979BD

View file

@ -25,9 +25,95 @@ Any model file that does not contain
in the root of the archive is invalid. in the root of the archive is invalid.
. .
.PP .PP
Example
.B model.toml:
.
.EX
[format]
version_major = 0
version_minor = 3
[model_info]
name = "Example Model"
version = "1.0"
[[part]]
texture = "tex/head.png"
bind = "head"
[[part]]
texture = "tex/face.png"
bind = "head"
follow = "face"
factor = 0.75
.EE
.
.PP
. .
In addition to the model descriptor, the model archive can contain other In addition to the model descriptor, the model archive can contain other
files (e.g. textures) that can be anywhere in the archive, including the root. files (e.g. textures) that can be anywhere in the archive, including the root.
. .
Unnecessary files should not be present in the archive, but archives with Unnecessary files should not be present in the archive, but archives with
unnecessary files are still valid. unnecessary files are still valid.
.
.
.SH KEYS
.SS format
.TP
version_major
Integer: Major version of the model format (e.g. 0 for v0.3).
.
.TP
version_minor
Integer: Minor version of the model format (e.g. 3 for v0.3).
.
.
.SS model_info
.TP
name
String: The name of the model (will be displayed in the window title).
.
.TP
version
String: A version string for the model (currently unused).
.
.
.SS part
.TP
texture
String: Path to a texture file in the archive. Required if
.B [[textures]]
is not present in the part.
.
.TP
bind
String: A bind point which the part will be bound to.
Possible values: null, head, face
.
.TP
follow
String: A bind point which the part will follow depending on
.B factor.
The part will copy the position of
.B bind
but move in the direction of
.B follow.
.
.TP
factor
Float: How far the part will move towards the
.B follow
point.
If negative, the part will move in the opposite direction.
.
.SS textures
.TP
file
Path to a texture file in the archive. Required if
.B texture
is not present in the part.
.
.TP
trigger
A trigger that will cause the part to use this texture.
Possible values: null, mouth-open