示例#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
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))