This extension allows users to assign personality attributes to a glTF node appended to a file. The attributes include agent
, personality
, and defaultMessage
. Currently this extension is only compatible with MagickML but will be adjusted to be interoperable with others as more options are available.
Usage:
npm install
node .\personalityOptimize.js .\tubbypet.vrm "tubby" "#agent is cheery" "nya nya!"
node .\personalityOptimize.js tubbypet.glb
OMI_personality
Original vs Optimized:
- 113_new.glb: 35M -> 113_new_output.glb: 20M
- Anata_1070_Guilty_v2.glb: 14M -> Anata_1070_Guilty_v2_output.glb: 11M
- tubbypet.glb: 1.8M -> tubbypets_output.glb: 380K
The overall performance depends on the specific use case and requirements.
Node extension
agent
(string) - The name of the agent assigned to the node.personality
(string) - Typically a long prompt describing the character and their backstory.defaultMessage
(string) - The default message for the node.
The following JSON schema defines the extension properties:
{
"definitions": {
"OMI_personality": {
"type": "object",
"properties": {
"agent": { "type": "string" },
"personality": { "type": "string" },
"defaultMessage": { "type": "string" }
}
}
},
"type": "object",
"properties": {
"extensions": {
"type": "object",
"properties": {
"OMI_personality": { "$ref": "#/definitions/OMI_personality" }
}
}
}
}
Here is an example of how the extension can be used in a glTF file:
{
"nodes": [
{
"name": "TubbyPet",
"extensions": {
"OMI_personality": {
"agent": "tubby",
"personality": "#agent is cheery.",
"defaultMessage": "nya nya!"
}
}
}
],
"extensionsUsed": ["OMI_personality"]
}