コード例 #1
0
ファイル: typ.py プロジェクト: kthulhu/mrv
def init_classhierarchy( ):
	""" Read a simple hiearchy file and create an Indexed tree from it"""
	mfile = make_path( __file__ ).parent().parent() / "cache/UICommandsHierachy.hf"

	# STORE THE TYPE TREE
	global _typetree
	_typetree = mrvmaya.dag_tree_from_tuple_list( mrvmaya.tuple_list_from_file( mfile ) )
コード例 #2
0
ファイル: __init__.py プロジェクト: mrv-developers/mrv
def addCustomTypeFromFile( hierarchyfile, **kwargs ):
    """Add a custom classes as defined by the given tab separated file.
    Call addCustomClasses afterwards to register your own base classes to the system
    This will be required to assure your own base classes will be used instead of auto-generated
    stand-in classes
    
    :param hierarchyfile: Filepath to file modeling the class hierarchy using tab-indentation.
        The root node has no indentation, whereas each child node adds one indentation level using 
        tabs.
    :param kwargs:
         * force_creation: see `addCustomType`
    :note: all attributes of `addCustomType` are supported
    :note: there must be exactly one root type
    :return: iterator providing all class names that have been added"""
    dagtree = mrvmaya.dag_tree_from_tuple_list( mrvmaya.tuple_list_from_file( hierarchyfile ) )
    typ._addCustomTypeFromDagtree( globals(), dagtree, **kwargs )
    return ( capitalize( nodetype ) for nodetype in dagtree.nodes_iter() )
コード例 #3
0
ファイル: mdb.py プロジェクト: adamcobabe/mrv
def createDagNodeHierarchy( ):
	""" Parse the nodes hierarchy file and return a `DAGTree` with its data
	:return: `DAGTree`"""
	mfile = nodeHierarchyFile()
	return mrvmaya.dag_tree_from_tuple_list( mrvmaya.tuple_list_from_file( mfile ) )
コード例 #4
0
def createDagNodeHierarchy():
    """ Parse the nodes hierarchy file and return a `DAGTree` with its data
	:return: `DAGTree`"""
    mfile = nodeHierarchyFile()
    return mrvmaya.dag_tree_from_tuple_list(
        mrvmaya.tuple_list_from_file(mfile))