src/bvhtoolbox/convert/csv2bvh.py
def _get_joint_string(nodes, joint):
    """ Compose bvh string representation of a joint in hierarchy with indentation according to its depth.
    
    :param nodes: Dictionary with skeleton hierarchy.
    :type nodes: dict
    :param joint: Name of the joint in question.
    :type joint: str
    :return: The joints part of the bvh hierarchy section.
    :rtype: str
    """
    depth = _get_joint_depth(nodes, joint)
    properties = nodes[joint]
    if not properties['parent']:
        s = '{0}ROOT {1}\n'.format('  ' * depth, str(joint))
    elif not properties['children']:
        s = '{0}{1}\n'.format('  ' * depth, 'End Site')
    else:
        s = '{0}JOINT {1}\n'.format('  ' * depth, str(joint))
        
    s += '{0}{{\n'.format('  ' * depth)
    s += '{0}{1} {2}\n'.format('  ' * (depth + 1), 'OFFSET', ' '.join(properties['offset'].astype(str)))
    if not properties['children']:
        s += '{0}}}\n'.format('  ' * depth)
    else:
        s += '{0}{1} {2} {3}\n'.format('  ' * (depth + 1), 'CHANNELS',
                                       len(properties['channels']),
                                       ' '.join(properties['channels']))
    return s
 Compose bvh string representation of a joint in hierarchy with indentation according to its depth.
    
    :param nodes: Dictionary with skeleton hierarchy.
    :type nodes: dict
    :param joint: Name of the joint in question.
    :type joint: str
    :return: The joints part of the bvh hierarchy section.
    :rtype: str
    
Compose bvh string representation of a joint in hierarchy with indentation according to its depth.
Compose bvh string representation of a joint in hierarchy with indentation according to its depth .
def _get_joint_string(nodes, joint):
    depth = _get_joint_depth(nodes, joint)
    properties = nodes[joint]
    if not properties['parent']:
        s = '{0}ROOT {1}\n'.format('  ' * depth, str(joint))
    elif not properties['children']:
        s = '{0}{1}\n'.format('  ' * depth, 'End Site')
    else:
        s = '{0}JOINT {1}\n'.format('  ' * depth, str(joint))
    s += '{0}{{\n'.format('  ' * depth)
    s += '{0}{1} {2}\n'.format('  ' * (depth + 1), 'OFFSET', ' '.join(properties['offset'].astype(str)))
    if not properties['children']:
        s += '{0}}}\n'.format('  ' * depth)
    else:
        s += '{0}{1} {2} {3}\n'.format('  ' * (depth + 1), 'CHANNELS',
                                       len(properties['channels']),
                                       ' '.join(properties['channels']))
    return s
def _get_joint_string ( nodes , joint ) : depth = _get_joint_depth ( nodes , joint ) properties = nodes [ joint ] if not properties [ 'parent' ] : s = '{0}ROOT {1}\n' . format ( '  ' * depth , str ( joint ) ) elif not properties [ 'children' ] : s = '{0}{1}\n' . format ( '  ' * depth , 'End Site' ) else : s = '{0}JOINT {1}\n' . format ( '  ' * depth , str ( joint ) ) s += '{0}{{\n' . format ( '  ' * depth ) s += '{0}{1} {2}\n' . format ( '  ' * ( depth + 1 ) , 'OFFSET' , ' ' . join ( properties [ 'offset' ] . astype ( str ) ) ) if not properties [ 'children' ] : s += '{0}}}\n' . format ( '  ' * depth ) else : s += '{0}{1} {2} {3}\n' . format ( '  ' * ( depth + 1 ) , 'CHANNELS' , len ( properties [ 'channels' ] ) , ' ' . join ( properties [ 'channels' ] ) ) return s
Compose bvh string representation of a joint in hierarchy with indentation according to its depth.
Compose bvh string representation of a joint in hierarchy with indentation according to its depth .
""" Compose bvh string representation of a joint in hierarchy with indentation according to its depth.
    
    :param nodes: Dictionary with skeleton hierarchy.
    :type nodes: dict
    :param joint: Name of the joint in question.
    :type joint: str
    :return: The joints part of the bvh hierarchy section.
    :rtype: str
    """
The joints part of the bvh hierarchy section.
The joints part of the bvh hierarchy section .
str
nodes
Dictionary with skeleton hierarchy.
Dictionary with skeleton hierarchy .
joint
Name of the joint in question.
Name of the joint in question .