Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

Repository files navigation

PyLiveLinkFace

PyLiveLinkFace enables you to receive data sent from Epics LiveLinkFace App and send your own facial data to the Unreal Engine using the LiveLink Plugin via python. It's designed that you don't need to change anything inside the Unreal Engine, if you can receive facial Data from the IPhone app, this libary will also work out of the box for you. Tested with Unreal Engine 4.27.

Prerequisites

To setup the LiveLink plugin and system in Unreal, see the following tutorial: https://docs.unrealengine.com/4.27/en-US/AnimatingObjects/SkeletalMeshAnimation/FacialRecordingiPhone/

Requirements

PyLiveLinkFace needs the following python libraries:

  • numpy
  • timecode

Install

To install it, clone the git repo and install it with the setup.py file:

python setup.py install

Usage

The default LiveLinkFace App works with UDP sockets on the Port 11111. You need to open an UDP-Socket for sending or receiving the data. For example files, see the examples folder

Sending data

To send facial data to the UnrealEngine, create a new PyLiveLinkFace object, connect an UDP socket and set your desired values. Finally pack all the data via the 'encode()' into bytes and send it over the socket.

frompylivelinkfaceimportPyLiveLinkFace, FaceBlendShapepy_face=PyLiveLinkFace()
UDP_IP="127.0.0.1"UDP_PORT=11111# connect to the udp socket of the running Unreal Projects=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect((UDP_IP, UDP_PORT))
# set the head rotation to random values py_face.set_blendshape(FaceBlendShape.HeadPitch, random.uniform(-1, 1))
py_face.set_blendshape(FaceBlendShape.HeadRoll,random.uniform(-1, 1))
py_face.set_blendshape(FaceBlendShape.HeadYaw, random.uniform(-1, 1))
# encode the PyLiveLinkFace data to bytes and send thems.sendall(py_face.encode())
s.close()

Receiving data

To receive facial data from an IPhone LiveLinkFace app or another PyLiveLinkFace instance, open an UDP socket and set your desired values. Finally unpack all the data via the 'deencode()' into a PyLiveLinkFace object.

frompylivelinkfaceimportPyLiveLinkFace, FaceBlendShapeUDP_PORT=11111s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# open a UDP socket on all available interfaces with the given ports.bind(("", UDP_PORT)) whileTrue: data, addr=s.recvfrom(1024) # decode the bytes data into a PyLiveLinkFace objectsuccess, live_link_face=PyLiveLinkFace.decode(data)
ifsuccess:
# get the blendshape value for the HeadPitch and print itpitch=live_link_face.get_blendshape(FaceBlendShape.HeadPitch)
print (live_link_face.name, pitch) passs.close()

About

No description, website, or topics provided.

Resources

Stars

172 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages