src/bvhtoolbox/convert/bvh2xaf_helpers.py
def joint2affine(bvh_tree, joint_name, frame=0, axes='rzxz'):
    """Read the tranforms of a joint with rotation in order given by axes and return it as an affine matrix.

    :param bvh_tree: BVH structure.
    :type bvh_tree: bvhtree.BvhTree
    :param joint_name: Name of the joint.
    :type joint_name: str
    :param frame: The frame to return.
    :type frame: int
    :param axes: The order in which to return the angles. Usually that's the joint's channel order.
    :type axes: str
    :return: affine matrix (4x4)
    :rtype: numpy.ndarray
    """
    translation = np.array(bvh_tree.frame_joint_channels(frame, joint_name, ['Xposition', 'Yposition', 'Zposition'],
                                                         value=0.0))  # For missing channels. bvh > v3.0!
    euler_ordered = np.radians(get_euler(bvh_tree, joint_name, frame, axes[1:]))
    rot_mat = t3d.euler.euler2mat(*euler_ordered, axes=axes)
    affine = t3d.affines.compose(translation, rot_mat, np.ones(3))
    return affine
Read the tranforms of a joint with rotation in order given by axes and return it as an affine matrix.

    :param bvh_tree: BVH structure.
    :type bvh_tree: bvhtree.BvhTree
    :param joint_name: Name of the joint.
    :type joint_name: str
    :param frame: The frame to return.
    :type frame: int
    :param axes: The order in which to return the angles. Usually that's the joint's channel order.
    :type axes: str
    :return: affine matrix (4x4)
    :rtype: numpy.ndarray
    
Read the tranforms of a joint with rotation in order given by axes and return it as an affine matrix.
Read the tranforms of a joint with rotation in order given by axes and return it as an affine matrix .
def joint2affine(bvh_tree, joint_name, frame=0, axes='rzxz'):
    translation = np.array(bvh_tree.frame_joint_channels(frame, joint_name, ['Xposition', 'Yposition', 'Zposition'],
                                                         value=0.0))  
    euler_ordered = np.radians(get_euler(bvh_tree, joint_name, frame, axes[1:]))
    rot_mat = t3d.euler.euler2mat(*euler_ordered, axes=axes)
    affine = t3d.affines.compose(translation, rot_mat, np.ones(3))
    return affine
def joint2affine ( bvh_tree , joint_name , frame = 0 , axes = 'rzxz' ) : translation = np . array ( bvh_tree . frame_joint_channels ( frame , joint_name , [ 'Xposition' , 'Yposition' , 'Zposition' ] , value = 0.0 ) ) euler_ordered = np . radians ( get_euler ( bvh_tree , joint_name , frame , axes [ 1 : ] ) ) rot_mat = t3d . euler . euler2mat ( * euler_ordered , axes = axes ) affine = t3d . affines . compose ( translation , rot_mat , np . ones ( 3 ) ) return affine
Read the tranforms of a joint with rotation in order given by axes and return it as an affine matrix.
Read the tranforms of a joint with rotation in order given by axes and return it as an affine matrix .
"""Read the tranforms of a joint with rotation in order given by axes and return it as an affine matrix.

    :param bvh_tree: BVH structure.
    :type bvh_tree: bvhtree.BvhTree
    :param joint_name: Name of the joint.
    :type joint_name: str
    :param frame: The frame to return.
    :type frame: int
    :param axes: The order in which to return the angles. Usually that's the joint's channel order.
    :type axes: str
    :return: affine matrix (4x4)
    :rtype: numpy.ndarray
    """ # For missing channels. bvh > v3.0!
affine matrix (4x4)
affine matrix ( 4x4 )
numpy.ndarray
bvh_tree
None
joint_name
Name of the joint.
Name of the joint .
frame
The frame to return.
The frame to return .
axes
The order in which to return the angles. Usually that's the joint's channel order.
The order in which to return the angles . Usually that ' s the joint ' s channel order .