# Path: mayaLib/rigLib/utils/util.py
# def getDriverDrivenFromConstraint(constraint):
# def returnDriverObject(attribute, skipConversionNodes=False):
# def returnDrivenAttribute(attribute, skipConversionNodes=False):
# def returnDrivenObject(attribute, skipConversionNodes=True):
# def getAllObjectUnderGroup(group, type='mesh'):
# def moveShape(source, destination):
# def get_distance(obj1, obj2):
#     def ctr_dist(objA, objB):
# def get_distance_from_coords(bboxMin, bboxMax):
# def lock_and_hide_all(node):
# def unlock_and_unhide_all(node):
# def no_render(tgt):
# def invertSelection():
# def getPlanarRadiusBBOXFromTransform(transform, radiusFactor=2):
# def matrixConstrain(driver, driven, parent=None, translate=True, rotate=True, scale=False):
# 
# Path: mayaLib/rigLib/Ziva/ziva_fiber_tools.py
# def getAllObjectUnderGroup(group, type='mesh'):
# def addZivaFiber(obj):
# def createLoACurve(obj):
# def rivetCurve(curve, skeleton):
# def addLoA(curve, obj):
# def createLineOfAction(obj, skeleton):
# 
# Path: mayaLib/rigLib/Ziva/ziva_attachments_tools.py
# def getAllObjectUnderGroup(group, type='mesh'):
# def zivaFixedAttachment(stiffness=8):
# def zivaSlidingAttachment(stiffness=8):
# def paintProximity(zAttachement, min=0.0001, max=1):
# def addAttachment(source, dest, value, fixed=True):
# 
# Path: mayaLib/rigLib/Ziva/ziva_tools.py
# def zPolyCombine(geos):
# def harmonic_warp(source, destination, transfer_geos, tet_size=1):
# def bone_warp(source, destination, transfer_geos, tet_size=1):
# def ziva_check_intersection(geo1, geo2):
# def zivaRenameAll():
# def zivaMirror(from_side='L_', to_side='R_', suffix='_GEO'):


from pathlib import Path
from mayaLib.rigLib.utils import util as util
from mayaLib.rigLib.Ziva import ziva_fiber_tools as fiber
from mayaLib.rigLib.Ziva import ziva_attachments_tools as attachment
from mayaLib.rigLib.Ziva import ziva_tools as tool
import pymel.core as pm
import maya.mel as mel
import zBuilder.utils as zutils
        self.muscle_grp = muscle_grp
        self.skeleton = util.getAllObjectUnderGroup(skeleton_grp)
        self.muscles = util.getAllObjectUnderGroup(muscle_grp)

        # make bone
        self.ziva_bone = addBone(self.skeleton)

        # make tissue
        self.ziva_tissue_muscles = []
        for geo in self.muscles:
            muscle = addTissue(geo, tet_size=tet_size)
            self.ziva_tissue_muscles.append(muscle)

        # attachment
        # - bone to muscle
        for geo in self.muscles:
            attachment.addAttachment(self.skeleton, geo, value=attachment_radius)

        # - muscle to muscle
        self.muscle_to_muscle_attachemnt(value=attachment_radius)

        # fiber
        self.curve_list = []
        self.rivets_list = []

        self.loa_grp = pm.group(n='loa_grp', em=True)
        self.curve_grp = pm.group(n='curve_grp', em=True, p=self.loa_grp)
        self.rivet_grp = pm.group(n='rivet_grp', em=True, p=self.loa_grp)

        for geo in self.muscles:

# Path: mayaLib/rigLib/utils/util.py
# def getDriverDrivenFromConstraint(constraint):
# def returnDriverObject(attribute, skipConversionNodes=False):
# def returnDrivenAttribute(attribute, skipConversionNodes=False):
# def returnDrivenObject(attribute, skipConversionNodes=True):
# def getAllObjectUnderGroup(group, type='mesh'):
# def moveShape(source, destination):
# def get_distance(obj1, obj2):
#     def ctr_dist(objA, objB):
# def get_distance_from_coords(bboxMin, bboxMax):
# def lock_and_hide_all(node):
# def unlock_and_unhide_all(node):
# def no_render(tgt):
# def invertSelection():
# def getPlanarRadiusBBOXFromTransform(transform, radiusFactor=2):
# def matrixConstrain(driver, driven, parent=None, translate=True, rotate=True, scale=False):
# 
# Path: mayaLib/rigLib/Ziva/ziva_fiber_tools.py
# def getAllObjectUnderGroup(group, type='mesh'):
# def addZivaFiber(obj):
# def createLoACurve(obj):
# def rivetCurve(curve, skeleton):
# def addLoA(curve, obj):
# def createLineOfAction(obj, skeleton):
# 
# Path: mayaLib/rigLib/Ziva/ziva_attachments_tools.py
# def getAllObjectUnderGroup(group, type='mesh'):
# def zivaFixedAttachment(stiffness=8):
# def zivaSlidingAttachment(stiffness=8):
# def paintProximity(zAttachement, min=0.0001, max=1):
# def addAttachment(source, dest, value, fixed=True):
# 
# Path: mayaLib/rigLib/Ziva/ziva_tools.py
# def zPolyCombine(geos):
# def harmonic_warp(source, destination, transfer_geos, tet_size=1):
# def bone_warp(source, destination, transfer_geos, tet_size=1):
# def ziva_check_intersection(geo1, geo2):
# def zivaRenameAll():
# def zivaMirror(from_side='L_', to_side='R_', suffix='_GEO'):


# Path: mayaLib/rigLib/Ziva/ziva_build.py
from pathlib import Path
from mayaLib.rigLib.utils import util as util
from mayaLib.rigLib.Ziva import ziva_fiber_tools as fiber
from mayaLib.rigLib.Ziva import ziva_attachments_tools as attachment
from mayaLib.rigLib.Ziva import ziva_tools as tool
import pymel.core as pm
import maya.mel as mel
import zBuilder.utils as zutils

        self.muscle_grp = muscle_grp
        self.skeleton = util.getAllObjectUnderGroup(skeleton_grp)
        self.muscles = util.getAllObjectUnderGroup(muscle_grp)

        # make bone
        self.ziva_bone = addBone(self.skeleton)

        # make tissue
        self.ziva_tissue_muscles = []
        for geo in self.muscles:
            muscle = addTissue(geo, tet_size=tet_size)
            self.ziva_tissue_muscles.append(muscle)

        # attachment
        # - bone to muscle
        for geo in self.muscles:
            attachment.addAttachment(self.skeleton, geo, value=attachment_radius)

        # - muscle to muscle
        self.muscle_to_muscle_attachemnt(value=attachment_radius)

        # fiber
        self.curve_list = []
        self.rivets_list = []

        self.loa_grp = pm.group(n='loa_grp', em=True)
        self.curve_grp = pm.group(n='curve_grp', em=True, p=self.loa_grp)
        self.rivet_grp = pm.group(n='rivet_grp', em=True, p=self.loa_grp)

        for geo in self.muscles:

            curve, rivets = fiber.createLineOfAction(geo, self.skeleton)