I've been quite busy this week, and produced a few scripts to optimize my workflow. Now i'm still a newbie at using the ziva system however these scripts have been fairly useful for for me! Feel free to use them!
In addition the Prune weight script is still a bit unstable so i'm currently in the process of fixing some bugs.
The error i receive is "object has no attribute 'winEvent'" after running the window multiple times
#######################################################################
#to simply run the command use:
#Build tissue with name
#ZivaBuildTissue()
#Attach objects
#ZiveMakeAttachements()
#######################################################################
import maya.cmds as mc
import maya.mel as mm
import maya.OpenMaya as om
def ZivaBuildTissue():
attrbuteobject = mc.ls(sl= True)[0]
tetSize = 6.0
youngsModulus = 4.0
surfaceRefinement = 1.0
contactStiffnessExp = 6
mc.select(attrbuteobject)
mm.eval('ziva -t;')
zTetNode = mm.eval('zQuery -t zTet;')
zTetRename = attrbuteobject + "_zTet"
mc.rename(zTetNode, zTetRename)
mc.setAttr(zTetRename + ".tetSize", tetSize)
mc.setAttr(zTetRename + ".surfaceRefinement", surfaceRefinement)
zTissueNode = mm.eval('zQuery -t zTissue;')
zTissueRename = attrbuteobject + "_zTissue"
mc.rename(zTissueNode, zTissueRename)
mc.setAttr(zTissueRename + ".contactStiffnessExp", contactStiffnessExp)
zGeoNode = mm.eval('zQuery -t zGeo;')
zGeoNodeRename = attrbuteobject + "_zGeo"
mc.rename(zGeoNode, zGeoNodeRename)
zMaterialNode = mm.eval('zQuery -t zMaterial;')
zMaterialRename = attrbuteobject + "_zMaterial"
mc.rename(zMaterialNode, zMaterialRename)
mc.setAttr(zMaterialRename + ".youngsModulus", youngsModulus)
def ZiveMakeAttachements():
attachmentMode = 1
stiffness = 3.0
stiffnessExp = 6
attrbuteobject = mc.ls(sl= True)
sourceObject = attrbuteobject[-1]
for attachmentObject in attrbuteobject[:-1]:
mc.select(sourceObject, attachmentObject, r= True)
attachmentNode = mm.eval('ziva -a;')
attachmentRename = sourceObject + "_" + attachmentObject
mc.rename(attachmentNode, attachmentRename)
mc.setAttr(attachmentRename + ".attachmentMode", attachmentMode)
mc.setAttr(attachmentRename + ".stiffness", stiffness)
mc.setAttr(attachmentRename + ".stiffnessExp", stiffnessExp)