Face capture¶
GoDNA Pro
Face capture is in GoDNA Pro. See Editions.
FaceCaptureReceiver (face_capture_receiver.gd) drives a GoDNAHuman's face and head live from a
face-tracking app on the local network, and records takes as Animations. It's the node behind
Face Studio, and it works the same in a running game.
Setup¶
- Add a
FaceCaptureReceiveras a child of the character (or set itstarget). -
Pick the
sourceand set up the app:Source App Usual port IPHONELive Link Face (ARKit mode). In the app, add this computer's IP and the port as a target. 11111 ANDROIDMeowFace, or the VTube Studio iPhone app. Set phone_addressto the phone's IP; the receiver keeps asking the phone for data.21412 FOXYFACEFoxyFace (PC webcam), its VRCFaceTracking output. Set its socket to this computer's IP ( 127.0.0.1on the same PC) and the port, or turn on its Auto Connect and the receiver sets both.25747 VMCVSeeFace, XR Animator and other VTuber apps. Turn on the app's VMC sender to this computer's IP and the port. 39539 -
Run the game and make a face. On Windows, allow Godot through the firewall if asked.
GoDNA isn't affiliated with or endorsed by these apps or their makers; they're separate products under their own terms. See License and trademarks.
var receiver := FaceCaptureReceiver.new()
receiver.source = FaceCaptureReceiver.Source.ANDROID
receiver.phone_address = "192.168.1.23"
$Ada.add_child(receiver)
The port opens when the node enters the tree, and again when source or port changes.
Properties¶
| Property | Default | |
|---|---|---|
source |
IPHONE |
The app protocol. |
port |
0 | UDP port; 0 uses the source's usual port. |
phone_address |
"" |
Android only: the phone's IP. |
target |
null | The character; empty means the parent, if it's a GoDNAHuman. |
apply_to_target |
true | Apply incoming frames. Turn off to play a recorded take while still receiving. |
apply_head |
true | Apply the head rotation (otherwise only the face moves). |
head_scale |
1.0 | Multiplies the head rotation. |
invert_head_yaw / _pitch / _roll |
false | Apps disagree on head directions; flip one if the head turns the wrong way. |
interpolate |
true | Blend between received frames when the app sends fewer frames than the game draws. Adds about one frame of delay. |
smoothing |
0.0 | Removes jitter (0 = off, 1 = heaviest). Still poses are smoothed a lot, fast moves such as blinks barely at all. |
smoothing_speed_response |
1.0 | How much fast movement cuts through the smoothing. |
mirror |
false | Swap left and right, as if the character were your reflection. |
timeout |
1.0 | Seconds without packets before the source counts as disconnected. |
record_tolerance |
0.002 | Recorded keys within this of the previous key are dropped. |
Every tracked weight goes through the character's tracking_influence (set in Face Studio), so the face, the
frame_received signal and recorded takes all have the calibrated weights.
Status¶
| Method | |
|---|---|
listen() -> Error |
(Re)opens the port. Called automatically. |
is_listening() -> bool |
False if the port couldn't be opened (another program holds it). |
get_port() -> int |
The port in use. |
is_receiving() -> bool |
True while packets arrive. |
has_face() -> bool |
True while the app tracks a face. |
get_packet_rate() -> float |
Frames per second over the last second. |
get_tracked_weight(shape) -> float |
A shape's weight as the app sent it, before tracking influence. |
get_sender() -> String |
IP address of the last sender. |
FaceCaptureReceiver.get_local_addresses() |
This computer's local IPv4 addresses, to enter in the app. |
Signals: frame_received(weights: Dictionary, head: Vector3) and connection_changed(receiving: bool).
Recording¶
receiver.start_recording()
# ...
var take := receiver.stop_recording() # null if no frames arrived
var path := FaceCaptureReceiver.save_take(take, "res://GoDNA/animations/face")
A take has one value track per ARKit shape (.:jawOpen, ...) and one for .:head_rotation, relative to the
character. Play it with an AnimationPlayer that is a child of any GoDNA character. save_take writes
take_YYYYMMDD_HHMMSS.res and returns its path.
Notes¶
- Unreal's Live Link holds port 11111 while the Unreal Editor is open. Use another port in both apps, or close Unreal.
- VMC apps send VRM expressions, which are mapped to ARKit shapes. Apps that track only a few expressions move only those shapes, and some (VSeeFace) don't track the eyes separately.
- MeowFace and VSeeFace are tested. FoxyFace's gaze and head directions and Live Link Face aren't verified yet; use the invert options if the head turns the wrong way.