-
Notifications
You must be signed in to change notification settings - Fork 0
Motion & Expressions
Eatgrapes edited this page Dec 28, 2025
·
1 revision
Static models are boring! Here is how to make them move.
Motions are .motion3.json files. You load them as byte arrays and play them.
byte[] motionBytes = loadResource("tap_body.motion3.json");
// Priority:
// 1 = Idle (can be interrupted)
// 2 = Normal
// 3 = Force (interrupts everything)
int priority = 3;
// Loop: true/false
boolean loop = false;
model.startMotion(motionBytes, priority, loop, name -> {
System.out.println("Motion " + name + " finished!");
});The model automatically fades between the current motion and the new one. You don't need to manage blending manually.
Expressions are .exp3.json files that override specific parameters (like setting eyes to "happy").
-
Load the Expression:
byte[] exprBytes = loadResource("f01.exp3.json"); model.loadExpression(exprBytes, "Happy"); // Give it a unique name
-
Activate it:
model.setExpression("Happy");
Expressions layer on top of motions. So if a motion blinks the eyes, but the expression forces them shut, they will stay shut.