anatools.lib.generator module¶
- class CreateBranchGenerator(children, **kwargs)¶
- Bases: - Generator- A generator that connects branches together - exec(*args, **kwargs)¶
- Select a child and execute it 
 
- class Generator(children=None, **kwargs)¶
- Bases: - ABC- Base class for generators and modifiers - clone()¶
- Clone a generator. The clone has no children. 
 - abstract exec(*args, **kwargs)¶
 - generators = {}¶
 - next_id = 0¶
 - select_child()¶
- Select a weighted random child 
 - toJSON()¶
 
- class ObjectGenerator(object_class, object_type, **kwargs)¶
- Bases: - Generator- Object Generator - exec(*args, **kwargs)¶
- Return a new instance of the specified object 
 
- class ObjectModifier(method, children, **kwargs)¶
- Bases: - Generator- Object Modifier - exec(*args, **kwargs)¶
- Execute modifier method on object 
 
- class PathList(paths=None)¶
- Bases: - list- A list of paths. Each path is a list of generator id’s from root to leaf - to_tree()¶
- Convert a PathList into an executable tree 
 
- create_multi_path(tree, leaf_class=<class 'anatools.lib.generator.ObjectGenerator'>)¶
- Create an executable multi path to a weighted random leaf. Path includes all possible routes to the leaf. 
- create_single_path(tree, leaf_class=<class 'anatools.lib.generator.ObjectGenerator'>)¶
- Create an exectuable single path to a weighted random leaf. 
- get_blendfile_generator(package, object_class, object_type)¶
- Helper function that creates a generator from an object definition in the package.yml file 
- get_file_generator(package, object_class, object_type)¶
- Helper function that creates a generator from an object definition in the package.yml file 
- get_unique_leaves(tree, leaf_class=<class 'anatools.lib.generator.ObjectGenerator'>)¶
- Get list of all unique leaves in the tree. 
