API Reference¶
-
class
zBuilder.builders.ziva.
Ziva
[source]¶ To capture a Ziva rig.
-
retrieve_from_scene
(get_parameters)[source]¶ This gets the scene items from the scene for further manipulation or saving. It works on selection or something passed in args. If nothing is selected it looks for a zSolver in the scene. If something is selected or passed it uses that specific solver to retrieve.
Items captured in this case are:
All the Ziva nodes. (zTissue, zTet, zAttachment, etc..)
Order of the nodes so we can re-create material layers reliably.
Attributes and values of the nodes. (Including weight maps)
Sub-tissue information.
User defined tet mesh reference. (Not the actual mesh)
Any embedded mesh reference. (Not the actual mesh)
Curve reference to drive zLineOfAction. (Not actual curve)
Relevant zSolver for each node.
Mesh information used for world space lookup to interpolate maps if needed.
- Parameters
get_parameters (bool) – To get parameters or not.
-
build
(name_filter=None, attr_filter=None, interp_maps='auto', mirror=False, permissive=True, check_meshes=True)[source]¶ This builds the Ziva rig into the Maya scene. It does not build geometry as the expectation is that the geometry is in the scene.
- Parameters
solver (bool) – Build the solver.
bones (bool) – Build the bones.
tissues (bool) – Build the tissue and tets.
attachments (bool) – Build the attachments.
materials (bool) – Build the materials.
fibers (bool) – Build the fibers.
embedder (bool) – Build the embedder.
cloth (bool) – Build the cloth.
fields (bool) – Build the fields.
lineOfActions (bool) – Build the line of actions.
interp_maps (str) – Option to interpolate maps. True: Yes interpolate False: No auto: Interpolate if it needs it (vert check)
mirror (bool) – This mirrors the geometry in bundle.
permissive (bool) – False raises errors if something is wrong. Defaults to True
attr_filter (dict) –
Attribute filter on what attributes to get. dictionary is key value where key is node type and value is list of attributes to use.
tmp = {‘zSolver’:[‘substeps’]}
association_filter (str) – filter by node association. Defaults to list()
-
-
class
zBuilder.builders.ziva.
Builder
[source]¶ The main entry point for using zBuilder.
-
write
(file_path, type_filter=list(), invert_match=False)[source]¶ Writes out the scene items to a json file given a file path.
- Parameters
file_path (str) – The file path to write to disk.
type_filter (list, optional) – Types of scene items to write.
invert_match (bool) – Invert the sense of matching, to select non-matching items. Defaults to
False
-
retrieve_from_file
(file_path)[source]¶ Reads scene items from a given file. The items get placed in the bundle.
- Parameters
file_path (
str
) – The file path to read from disk.
-
string_replace
(search, replace)[source]¶ Searches and replaces with regular expressions scene items in the builder.
- Parameters
search (
str
) – what to search forreplace (
str
) – what to replace it with
Example
replace r_ at front of item with l_:
>>> z.string_replace('^r_','l_')
replace _r at end of line with _l:
>>> z.string_replace('_r$','_l')
-
stats
()[source]¶ Prints out basic information in Maya script editor. Information is scene item types and counts.
-
print_
(type_filter=[], name_filter=[])[source]¶ Prints out basic information for each scene item in the Builder. Information is all information that is stored in the __dict__. Useful for trouble shooting.
- Parameters
type_filter (
list
orstr
) – filter by parameter type. Defaults tolist
name_filter (
list
orstr
) – filter by parameter name. Defaults tolist
-
get_scene_items
(type_filter=[], name_filter=[], name_regex=None, association_filter=[], association_regex=None, invert_match=False)[source]¶ Gets the scene items from builder for further inspection or modification.
- Parameters
type_filter (
str
orlist
, optional) – filter by parametertype
. Defaults tolist
.name_filter (
str
orlist
, optional) – filter by parametername
. Defaults tolist
.name_regex (
str
) – filter by parameter name by regular expression. Defaults toNone
.association_filter (
str
orlist
, optional) – filter by parameterassociation
. Defaults tolist
.association_regex (
str
) – filter by parameterassociation
by regular expression. Defaults toNone
.invert_match (bool) – Invert the sense of matching, to select non-matching items. Defaults to
False
- Returns
List of scene items.
- Return type
list
-