目录
bvh_tool.py
import re
import numpy as np
channelmap = {
'Xrotation': 'x',
'Yrotation': 'y',
'Zrotation': 'z'
}
channelmap_inv = {
'x': 'Xrotation',
'y': 'Yrotation',
'z': 'Zrotation',
}
ordermap = {
'x': 0,
'y': 1,
'z': 2,
}
def load(filename:str, order:str=None) -> dict:
"""Loads a BVH file.
Args:
filename (str): Path to the BVH file.
order (str): The order of the rotation channels. (i.e."xyz")
Returns:
dict: A dictionary containing the following keys:
* names (list)(jnum): The names of the joints.
* parents (list)(jnum): The parent indices.
* offsets (np.ndarray)(jnum, 3): The offsets of the joints.
*