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.

Existing scene items are retained. If this retrieve finds a scene items with the same long name as an existing scene item, it replaces the old one.

Parameters

get_parameters (bool) – To get parameters or not.

build(name_filter=None, attr_filter=None, interp_maps='auto', mirror=False, permissive=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 for

  • replace (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 or str) – filter by scene_item type. Defaults to list

  • name_filter (list or str) – filter by scene_item name. Defaults to list

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 or list, optional) – filter by scene_item type. Defaults to list.

  • name_filter (str or list, optional) – filter by scene_item name. Defaults to list.

  • name_regex (str) – filter by scene_item name by regular expression. Defaults to None.

  • association_filter (str or list, optional) – filter by scene_item association. Defaults to list.

  • association_regex (str) – filter by scene_item association by regular expression. Defaults to None.

  • invert_match (bool) – Invert the sense of matching, to select non-matching items. Defaults to False

Returns

List of scene items.

Return type

list