src/bvhtoolbox/convert/csv2bvh.py
def hierarchy_sanity_check(nodes):
    """ Checks for errors in the skeleton's hierarchy.
    
    :param nodes: Dictionary with skeleton hierarchy.
    :type nodes: dict
    :return: True if no error occurred.
    :rtype: bool
    """
    found_root = False
    for node, properties in nodes.items():
        parent = properties['parent']
        if not parent:
            if found_root:
                raise ValueError("ERROR: Hierarchy can't have more than 1 root!")
            else:
                found_root = True
        if node == parent:
            raise ValueError("ERROR: Joint {} cannot be parent of itself!".format(node))
        if parent in properties['children']:
            raise ValueError("Impossible cyclic relation detected for joints {} and {}!".format(node, parent))
        if parent and parent not in nodes.keys():
            raise ValueError("ERROR: Parent of joint {} cannot be found in the hierarchy definition!".format(node))
    if not found_root:  # Would probably be caught before.
        raise ValueError("ERROR: No root joint found in the hierarchy definition!")
        
    # No error occurred.
    return True
 Checks for errors in the skeleton's hierarchy.
    
    :param nodes: Dictionary with skeleton hierarchy.
    :type nodes: dict
    :return: True if no error occurred.
    :rtype: bool
    
Checks for errors in the skeleton's hierarchy.
Checks for errors in the skeleton ' s hierarchy .
def hierarchy_sanity_check(nodes):
    found_root = False
    for node, properties in nodes.items():
        parent = properties['parent']
        if not parent:
            if found_root:
                raise ValueError("ERROR: Hierarchy can't have more than 1 root!")
            else:
                found_root = True
        if node == parent:
            raise ValueError("ERROR: Joint {} cannot be parent of itself!".format(node))
        if parent in properties['children']:
            raise ValueError("Impossible cyclic relation detected for joints {} and {}!".format(node, parent))
        if parent and parent not in nodes.keys():
            raise ValueError("ERROR: Parent of joint {} cannot be found in the hierarchy definition!".format(node))
    if not found_root:  
        raise ValueError("ERROR: No root joint found in the hierarchy definition!")
    return True
def hierarchy_sanity_check ( nodes ) : found_root = False for node , properties in nodes . items ( ) : parent = properties [ 'parent' ] if not parent : if found_root : raise ValueError ( "ERROR: Hierarchy can't have more than 1 root!" ) else : found_root = True if node == parent : raise ValueError ( "ERROR: Joint {} cannot be parent of itself!" . format ( node ) ) if parent in properties [ 'children' ] : raise ValueError ( "Impossible cyclic relation detected for joints {} and {}!" . format ( node , parent ) ) if parent and parent not in nodes . keys ( ) : raise ValueError ( "ERROR: Parent of joint {} cannot be found in the hierarchy definition!" . format ( node ) ) if not found_root : raise ValueError ( "ERROR: No root joint found in the hierarchy definition!" ) return True
Checks for errors in the skeleton's hierarchy.
Checks for errors in the skeleton ' s hierarchy .
""" Checks for errors in the skeleton's hierarchy.
    
    :param nodes: Dictionary with skeleton hierarchy.
    :type nodes: dict
    :return: True if no error occurred.
    :rtype: bool
    """ # Would probably be caught before. # No error occurred.
True if no error occurred.
True if no error occurred .
bool
nodes
Dictionary with skeleton hierarchy.
Dictionary with skeleton hierarchy .