Character: Difference between revisions

Jump to navigation Jump to search
1,021 bytes added ,  19 August 2023
no edit summary
No edit summary
No edit summary
Line 43: Line 43:


== Technical details ==
== Technical details ==
The character starts off as a 3D model which has limb parts, an armature and some animations. The model is then exported as glTF. From there, a custom definition file must be created containing...
The character starts off as a 3D model which has limb parts, an armature and some animations. The model is then exported as glTF, with '''Custom Properties''' on the primary Armature defining the following properties:


* The exported character model (+Y Up, include animations, do NOT include materials, apply modifiers if applicable)
* The exported character model (+Y Up, include animations, do NOT include materials, apply modifiers if applicable)
Line 59: Line 59:
* Accessory support - Accessory type + relative origin point translation and quaternion + max amount.  
* Accessory support - Accessory type + relative origin point translation and quaternion + max amount.  


==== glTF Custom Properties for supported character models ====
Scale and Unit references '''1x1x1 scale Brick being 1 unit in size in each axis.'''
{| class="wikitable"
{| class="wikitable"
|+Character binary format draft
|+Armature Custom Properties
!Marker
!Property
!Length (uint32)
!Type
!Contents
!Mandatory
!Values
!Notes
!Notes
|-
|-
|ba fb 00
|FBLXC.Version
|int
|yes
|1
|1
|Version (uint8)
|Character model version
|Format marker for
<code>application/x-freeblox-character</code>
<code>.vfbc</code>
|-
|-
|ba aa 00
|FBLXC.Parts
|Number of entries
|string
|Part (string) : Mesh Asset ID (string) : Bone (string) : AttachTo (string) : PointOrigin (vec3)
|yes
|Character parts
|Part names separated by comma
|Tell the engine about the parts in this model.
This is used to convert the meshes into GameObjects.
Example line: Head,Torso,Arm.L,Arm.R,Leg.L,Leg.R
'''NB! Commas are forbidden in mesh names for this reason!'''
|-
|-
|ba ab 00
|FBLXC.ColorParts
|Data length
|string
|Min scale (float) : Max scale (float) : Unit height (float)
|no
|
|Part names separated by comma
|Colorable parts list
Example line: Head,Torso,Arm.L,Arm.R,Leg.L,Leg.R
|-
|-
|ba bf 00
|FBLXC.MinScale
|Number of entries
|float
|Accessory type (enum uint8):Count (uint8):AttachTo (string):PointOrigin (vec3):QuatOrigin(quat)
|yes
|
|1
|Minimum applicable scale within the character editor
|-
|FBLXC.MaxScale
|float
|yes
|1
|Maximum applicable scale within the character editor
|-
|FBLXC.UnitHeigth
|int
|yes
|1
|Character height in game units
|-
|FBLXC.Accessory
|string
|no
|Accessory types separated by comma
|Currently supported accessories: Hat,Face,Tool,Front,Back
|-
|FBLXC.Accessory.Hat.Parent
|string
|yes, if accessory in list
|Accessory parent object
|Default could be Torso
|-
|FBLXC.Accessory.Hat.Origin
|float array, 3
|yes, if accessory in list
|3D Vector
|Accessory origin relative to the parent
|-
|FBLXC.Accessory.Hat.Quat
|float array, 4
|no
|4D Quaternion
|Accessory origin rotation relative to the parent
|-
|-
|ba de 00
|FBLXC.Accessory.Hat.Amount
|Number of entries
|int
|Texture type (enum uint8)
|no
|
|Defaults to just one if accessory is defined
|Amount of accessories of type supported.
|-
|-
|ba cd 00
|FBLXC.Texture.TShirt
|String length
|string
|Author information (string)
|no
|
|Part names separated by comma
|TShirt,Shirt,Pants applicable parts.
The texture specified will only be applied to the listed parts.
|-
|-
|ba ff 00
|FBLXC.Author
|Binary size
|string
|Model file
|no
|glTF binary data
|Any text referencing the author
|Custom character author information
|}
|}
<small>Note 1: <code>:</code> is shorthand for NUL byte (x00).</small>

Navigation menu