Ollo SDK for Godot 4 ships as a GDExtension addon. It opens the webcam, tracks the eyes and reports each blink to your game, or you can feed it frames yourself.
ollo-godot-windows-x86_64-v<version>.zipExtract the zip into your project's folder. It adds addons/ollo/: the plugin and its scripts, and in bin/ the SDK, its model and the DLLs it needs.
Enable the plugin: Project > Project Settings > Plugins, tick Ollo.
Sign the machine in, once, from a terminal in your project's folder, and approve the code in your browser (SDK Activation):
addons\ollo\bin\ollo.exe sign-in
The Output panel prints this command whenever the machine is not signed in. Until it is, the game you run shows Ollo's evaluation watermark, and tracking stops after 10 minutes each run.
Register the game under Games & builds on your dashboard, by its App ID (Project Settings > Ollo > App Id).
Nothing to set up: on a paid plan every export of a registered game is stamped, so the exported game runs with no watermark and no time limit on any machine, offline. The stamp is made for the Ollo release in the addon: after updating the addon, export again.
On a build server, set OLLO_BUILD_TOKEN to a build token from your dashboard; exports made there are stamped with it. An export that can't be stamped still completes, and the output says why and what to do. Without a stamp, the exported game is an evaluation: watermarked, with tracking that stops after 10 minutes each time it runs.
The zip holds the addon, with no sample scene. Attach this to any node in your project, and check that no other app is using your webcam:
extends Node
var bridge := OlloGodotBridge.new()
func _ready() -> void:
if not bridge.start():
push_error(bridge.get_last_error_string())
func _process(_delta: float) -> void:
for blink in bridge.poll_blink_events():
print("Blink ", blink.sequence, ": ", blink.duration_ms, " ms")
func _exit_tree() -> void:
bridge.stop()
bridge.free()
Run the scene and blink: each one prints in the Output panel.
Nothing frees the bridge for you: stop and free it when you're done, as _exit_tree does above. Fields and the gaze steps are in the API Reference.
| Method | What it does |
|---|---|
start(model_path = "", camera_index = 0, width = 640, height = 480, fps = 30, enable_pose_normalization = true, telemetry_enabled = true, enable_gaze = false) | Starts tracking, and returns false if it can't. Camera index -1 means you feed the frames. |
stop() | Stops tracking. |
poll_blink_events() | Call once per frame. Returns the new events as an array of dictionaries, and emits blink_detected or microsleep_detected for each one. |
is_blink_detected() | True if a blink has happened since the last call. Reading it clears it, so call it from one place, once a frame. |
get_blink_count() | Blinks since tracking started. |
get_last_blink_time() | The time of the last blink, in seconds. |
is_eye_closed() | Whether the eyes are closed right now. |
get_state() | Tracking state, as a dictionary. |
get_performance() | How tracking is running, as a dictionary. |
get_gaze() | Where the player is looking, as a dictionary. Needs enable_gaze and calibration. |
add_gaze_calibration_point(x, y, persistent = true) | Tells Ollo where the player is looking right now. Returns false if it can't use this frame: try again on the next one. |
clear_gaze_calibration() | Forgets all calibration. |
feed_image(img) | Feeds a frame, timed from the fps you started with. |
feed_image_timestamped(img, timestamp_sec) | Feeds a frame at the time you give. |
get_last_error() | The last error code. |
get_last_error_string() | The last error, in words. |
get_version() | The SDK's version. |
| Signal | When |
|---|---|
blink_detected(event) | For each blink, with a dictionary of its fields. Emitted by poll_blink_events(), so call that every frame. |
microsleep_detected(event) | When eyes that stayed shut for over a second reopen. Also emitted by poll_blink_events(). |
startup_failed(error) | start() failed. error is the message. |
stopped(error, message) | Tracking stopped by itself, because the evaluation ended. |
get_last_error() gives a code, and get_last_error_string() says it in words. The API Reference lists every code, with what to do for each.
Without a license Ollo runs as an evaluation: with the watermark, for 10 minutes of tracking each time the game runs. Error 8 means that time is used up: sign the machine in, or export on a paid plan. The bridge emits stopped when it happens.