Motion capture conversion utilities.
Project description
mocap-converter
mocap-converter is a library for turning motion-capture recordings into
formats that downstream tools can reuse. It converts joint position traces
captured during a mocap session into joint rotation data, making it easy to
repurpose captured motion in other contexts.
Installation
Install with uv:
$ uv add mocap-converter
Or install with pip:
$ pip install mocap-converter
Usage
Convert Azure Kinect Data to BVH
The snippet below loads Azure Kinect Body Tracking data exported by the Offline Processor, derives joint rotations from the recorded global joint positions, and saves the result as a BVH animation.
import json
from mocap_converter.adapter.azure_kinect import (
AZURE_KINECT_KINEMATIC_TREE,
get_positions_from_json,
)
from mocap_converter.adjust_kinematic_tree import adjust_kinematic_tree
from mocap_converter.io.bvh.saver import save_bvh
from mocap_converter.motion_data import MotionData
from mocap_converter.pos2rot import get_rotations_from_positions
with open("path/to/kinect_capture.json") as raw:
kinect_data = json.load(raw)
positions = get_positions_from_json(kinect_data)
# Apply optional smoothing (e.g., a median filter) here if the capture contains noisy frames.
kinematic_tree = adjust_kinematic_tree(AZURE_KINECT_KINEMATIC_TREE, positions)
root = kinematic_tree.root
positional_motion = MotionData(kinematic_tree, positions)
rotations = get_rotations_from_positions(positional_motion, current_node_name=root.name)
rotational_motion = MotionData(
kinematic_tree,
positions={root.name: positions[root.name]},
rotations=rotations,
)
save_bvh(rotational_motion, "path/to/output.bvh")
License
mocap-converter is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mocap_converter-0.0.1.tar.gz.
File metadata
- Download URL: mocap_converter-0.0.1.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63120b466a04d9c59a12d9bf3d8152a2b1d82623d538a06f58c6571a4c2e0dc3
|
|
| MD5 |
5f5ea6be6fe36f546077a6218a6fd00f
|
|
| BLAKE2b-256 |
5affe055df05c45f6aadbf0eead0f8fe92301b0912e53ae6afb9fcd1ee707168
|
Provenance
The following attestation bundles were made for mocap_converter-0.0.1.tar.gz:
Publisher:
publish.yml on yukihiroK/mocap-converter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mocap_converter-0.0.1.tar.gz -
Subject digest:
63120b466a04d9c59a12d9bf3d8152a2b1d82623d538a06f58c6571a4c2e0dc3 - Sigstore transparency entry: 567021889
- Sigstore integration time:
-
Permalink:
yukihiroK/mocap-converter@27998075ff21e13274d7b5b2b673f087824cfa59 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/yukihiroK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@27998075ff21e13274d7b5b2b673f087824cfa59 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mocap_converter-0.0.1-py3-none-any.whl.
File metadata
- Download URL: mocap_converter-0.0.1-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbda9c3c77924d8daa5eea94409e419af829431bc8a9b77373f54d886e5528b4
|
|
| MD5 |
5c4cc63abde943135b89ea8ef3f77059
|
|
| BLAKE2b-256 |
b93c760a18d38623e4176bbe420c5c322dd60313b6c40d627975a12f51380f6c
|
Provenance
The following attestation bundles were made for mocap_converter-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on yukihiroK/mocap-converter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mocap_converter-0.0.1-py3-none-any.whl -
Subject digest:
fbda9c3c77924d8daa5eea94409e419af829431bc8a9b77373f54d886e5528b4 - Sigstore transparency entry: 567021902
- Sigstore integration time:
-
Permalink:
yukihiroK/mocap-converter@27998075ff21e13274d7b5b2b673f087824cfa59 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/yukihiroK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@27998075ff21e13274d7b5b2b673f087824cfa59 -
Trigger Event:
release
-
Statement type: