20tab / bvh-python

Python module for parsing BVH (Biovision hierarchical data) mocap files
MIT License
233 stars 44 forks source link

Exporting and slicing #11

Open Saeki-M opened 3 years ago

Saeki-M commented 3 years ago

Added exporting to bvh file and slicing in ms.

from bvh import Bvh

mocap = Bvh.from_file('tests/test_freebvh.bvh')

# clip 1000 ms ~ 3000ms
clipped_mocap = mocap[1000:3000]

# get duration in ms
assert len(clipped_mocap) == 2000

# save to new file
clipped_mocap.export('new.bvh')