Metadata-Version: 2.1
Name: PyMoCapViewer
Version: 0.0.15
Summary: A once-simple 3D motion capture visualizer that is becoming more advanced over time.
Author-email: Justin Amadeus Albert <justin_albert@gmx.de>
Project-URL: Homepage, https://github.com/justamad/PyMoCapViewer
Project-URL: Issues, https://github.com/justamad/PyMoCapViewer
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: vtk ==9.3.1
Requires-Dist: open3d ==0.18.0
Requires-Dist: numpy ==2.0.1
Requires-Dist: pandas ==2.2.2
Requires-Dist: scipy ==1.14.0

![Alt text](docs/title_image.PNG)

# PyMoCapViewer Documentation

PyMoCapViewer is a Python package designed to visualize motion capture data in a user-friendly and interactive manner. It allows you to load various mocap file formats, animate the skeleton, and control the viewing experience with keyboard shortcuts.

# Installation

You can install PyMoCapViewer using pip:

```bash
pip install PyMoCapViewer
```

# Keyboard Shortcuts
The following keyboard shortcuts are available for interacting with PyMoCapViewer:

| Key               | Action                     |
|-------------------|----------------------------|
| Space             | Play/pause animation       | 
| s                 | Capture screenshot         |
| Enter             | Capture Screenvideo        |
| i                 | Print current frame number |
| 0                 | Jump to first frame        |
| Left/Right Arrow  | Previous/Next frame        |
| Left Mouse Button | Interact with scene        |
| q                 | Quit application           |


# Example Usage

Load the kinematic data as a Pandas Dataframe. The columns should contain the joints in the following format: J1 (x), J1 (y), J1 (z), ..., JN (x), JN (y), JN (z).

```python
from PyMoCapViewer import MoCapViewer
from PyMoCapViewer.examples import get_azure_data, get_vicon_data

df_pos, df_ori = get_azure_data()
viewer = MoCapViewer(sphere_radius=0.01, sampling_frequency=30)
viewer.add_skeleton(df_pos, skeleton_connection="azure", skeleton_orientations=df_ori, orientation="quaternion")
viewer.show_window()

df = get_vicon_data()
viewer = MoCapViewer(sphere_radius=0.01, sampling_frequency=100)
viewer.add_skeleton(df, skeleton_connection="vicon", color="red")
viewer.show_window()
```
