From bd69bfea16e4dc0b0e8979b1a64445c48cc6b828 Mon Sep 17 00:00:00 2001 From: Epicalert Date: Mon, 1 Mar 2021 00:56:30 +0800 Subject: [PATCH 1/4] Add description section --- docs/model-format.man | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/model-format.man diff --git a/docs/model-format.man b/docs/model-format.man new file mode 100644 index 0000000..3f1cd3d --- /dev/null +++ b/docs/model-format.man @@ -0,0 +1,33 @@ +.TH FC2D_MODEL 5 "Facecam2D Model Format 0.3 Manual" +. +.SH NAME +fc2d_model \- Facecam2D model file format +. +. +.SH DESCRIPTION +Facecam2D uses +.B zip +archive files using the +.I .fma (Facecam2D model archive) +file extension, to store models. +. +These zip files contain a mandatory +.I toml +file called +.B model.toml, +which describes the model and its parts. +. +This file is called the +.B model descriptor. +. +Any model file that does not contain +.B model.toml +in the root of the archive is invalid. +. +.PP +. +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. +. +Unnecessary files should not be present in the archive, but archives with +unnecessary files are still valid. From 10f36ef3fb679ea320ac7f01768cdc6236c44527 Mon Sep 17 00:00:00 2001 From: Epicalert Date: Tue, 9 Mar 2021 23:10:16 +0800 Subject: [PATCH 2/4] Add example and description for keys --- docs/model-format.man | 86 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/docs/model-format.man b/docs/model-format.man index 3f1cd3d..ccc43b2 100644 --- a/docs/model-format.man +++ b/docs/model-format.man @@ -25,9 +25,95 @@ Any model file that does not contain in the root of the archive is invalid. . .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 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 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 From 89d77f724d029b5540b237bf76e449c733ab9f8b Mon Sep 17 00:00:00 2001 From: Epicalert Date: Fri, 19 Mar 2021 23:38:53 +0800 Subject: [PATCH 3/4] Add part with multiple textures to example --- docs/model-format.man | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/model-format.man b/docs/model-format.man index ccc43b2..c357cee 100644 --- a/docs/model-format.man +++ b/docs/model-format.man @@ -42,10 +42,16 @@ texture = "tex/head.png" bind = "head" [[part]] -texture = "tex/face.png" bind = "head" follow = "face" factor = 0.75 + + [[textures]] + file = "tex/face-closedmouth.png" + + [[textures]] + file = "tex/face-openmouth.png" + trigger = "mouth-open" .EE . .PP @@ -117,3 +123,7 @@ is not present in the part. trigger A trigger that will cause the part to use this texture. Possible values: null, mouth-open +. +.PP +When specifying multiple textures, the first one specified +will be used by default. From 86689e41d2d79262199a824e0fed7018b7bad52f Mon Sep 17 00:00:00 2001 From: Epicalert Date: Wed, 31 Mar 2021 15:14:13 +0800 Subject: [PATCH 4/4] Add a newline for clarity --- docs/model-format.man | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/model-format.man b/docs/model-format.man index c357cee..2e166f5 100644 --- a/docs/model-format.man +++ b/docs/model-format.man @@ -28,6 +28,8 @@ in the root of the archive is invalid. Example .B model.toml: . +.sp +. .EX [format] version_major = 0