Motion capture for the character models of Honkai: Star Rail base on Unity and MediaPipe.
Currently face only.
- Face capture only supports character models with facial skeleton, e.g., the models ripped directly from StarRail.
Protocols between the server and the client are written in protobuf and compiled using my customized version of protoc.
Developed with Python 3.10.
It captures motion data using your webcam or from a video file and sends them to clients.
All the requirements are listed in Server/requirements.txt.
Enter the Server folder and create a virtual environment. Then, run the command below.
pip install -r requirements.txt
Edit Server/src/config.py.
Run Server/src/main.py.
Developed with Unity 2022.3.
- My Protobuf-Unity package.
-
Prepare a character model in the scene.
-
Prepare a blend shape asset to drive the character's facial expression.
If you are using a datamined model, after setting its
Scale Factor
to150
in the Import Settings, you can directly use the blend shape asset in the Client/BlendShapes folder.To create a custom blend shape asset, please read the 'Create custom blend shape asset' section.
-
Add a
Motion Actor (Game Model)
component to your character. -
Add a
UDP Session
component to the scene and set the server's address and port. Then, drag your actors ontoActors
field.
Simply enter play mode in your Unity editor.
-
Create asset using context menu.
-
Double click the asset to open the editor. Assign the face renderer of the character to
Debug Skinned Mesh Renderer
. -
This editor supports Record/Preview mode like Unity's AnimationWindow, so you can use it as if you were using AnimationWindow.
-
Use the tools to increase efficiency.