# ziva¶

After loading the Ziva plugin, you will have access to our “ziva” command. This command with its flags will make it possible for you to create anything available in our ziva menu (as well as some additional functionality not yet exposed as a button) and allow you to add that functionality to your scripts. The usage is: ziva <flags>

You can see the flags by loading the plugin, and executing ziva -h; This will present you with the following output:

ziva -h;
// Result: Flags:
ziva ...
-h     -help                  <n/a>        This message.
-s     -solver                <n/a>        Creates an empty solver.
-b     -bone                  <n/a>        Creates a "bone" (externally animated object) from the selected Maya mesh(es).
-t     -tissue                <n/a>        Creates a "tissue" (simulated deformable solid) from the selected Maya mesh(es).
-c     -cloth                 <n/a>        Creates a "cloth" (simulated deformable polygonal mesh) from the selected Maya mesh(es).
-rm    -remove                <n/a>        Removes all selected bodies (tissues, cloth, bones).
-tm    -tissueCopyMesh        <n/a>        Makes the tissue mesh a copy of the selected Maya mesh.
-m     -material              <n/a>        Adds a zMaterial node(s) to the selected "tissue(s)".
-f     -fiber                 <n/a>        Adds a zFiber node(s) to the selected "tissue(s)".
-loa   -lineOfAction          <n/a>        Connects the specified curve to the specified zFiber via a zLineOfAction node to drive excitation.
-ast   -addSubtissue          <n/a>        Sets the first specified tissue to have all of the remaining tissues as subtissues.
-rst   -removeSubtissue       <n/a>        Sets the selected subtissues to be stand-alone tissues, disconnecting them from their parent tissue.
-tcm   -tissueCollisionMesh   <n/a>        Selects a tissue and a mesh to use for collisions with that tissue.
-rcm   -removeCollisionMesh   <n/a>        Removes the alternate collision meshes associated with the selected tissues.
-e     -embed                 <n/a>        Selects tissue and a 'hero' Maya mesh to deform based on the tissue's motion.
-re    -removeEmbed           <n/a>        Un-embeds selected meshes from the tissue meshes they're embedded in.
-a     -attachment            <n/a>        Selects the bodies (tissues or bones) you would like to attach in the order of:
source, target. The projection will originate at the source.
-ga    -goalingAttachment     <n/a>        Selects the tissue mesh and a goal bone that you would like the tissue to goal to.
-sai   -swapAttachmentInputs  <n/a>        Selects the attachment(s) whose inputs you would like to swap and execute this command.
-acn   -addCacheNode          <n/a>        Adds a simulation cache node to the selected solver if one doesn't already exist.
-cut   -connectUserTetMesh    <n/a>        Connects any user supplied tet mesh to the selected tissue. This replaces the
automatically-generated mesh for the simulation.
-dut   -detachUserTetMesh     <n/a>        Detaches any user-supplied tet mesh from the selected tissue. This causes the
tissue to use an automatically-generated mesh for the simulation.
-mq    -meshQuality           <n/a>        This selects vertices that are connected to mesh components that do not meet
the input requirements of our system (mesh is not closed, contains non-manifold edges,
contains poor quality triangles with tiny angles).
-r     -refresh               <n/a>        Refreshes the selected solver.
-i     -info                  <n/a>        Prints info about the current solver, e.g., number of vertices in the tet mesh, etc.
-ds    -defaultSolver         solverName   Sets the default solver to solverName, or infers it from selection if solverName not specified.
The default solver is used for ziva commands whereby there is two or more solvers
in the scene, and the specific solver was not explicitly selected, and the selected
objects do not belong to any solver. The detailed specification is in the User's Manual ("Menus" section).
-sel   -selectSolver                       Selects the solver node that contains the selected Ziva object. If selection contains
no Ziva objects, selects the solver (if there is exactly 1 solver in the scene), or the
default solver (if 2 or more solvers in the scene).
-vb    -verbosity             <int>        Sets console verbosity level. Each level automatically displays all lower levels. Default: 2.
0: only show errors,  1: also show warnings,
2: also show important notices, 3: also show operation and progress.
Returns the set verbosity level.
-vbq   -verbosityQuery        <n/a>        Returns the current verbosity level.
-cf    -connectField          <nodeNames>  With no arguments, connects all selected Field nodes to all selected Ziva bodies.
If passed a set of node names, will attempt to connect specified Field nodes to specified Ziva bodies.
This functionality is used to model external forces to be applied to the Ziva bodies, using Maya fields.
-z     -about                 <n/a>        Prints product info.

Usage example:
First, create a solver:
ziva -s;
Then select the Maya meshes you want to add to the solver, and then create tissues from those Maya meshes by executing:
ziva -t;
If there is more than one solver in the scene, you should select the solver before running ziva commands; or use ziva -ds.
The command will return the name of the created node(s). //


For all flags that create new nodes in Maya, the node names of the created nodes will be returned when executing the command. You can then capture this return for the purpose of procedurally editing the parameters of the newly created nodes.

We now list several scripting commands, available in the “Ziva Tools” menu. These commands are designed to facilitate the workflows with our Ziva plugin.