# 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):


import inspect
import pymel.core as pm
from mayaLib.rigLib.utils import util
    from mayaLib.rigLib.utils import ikfkSwitch
__author__ = 'Lorenzo Argentieri'





class IKFKSwitch():
    def __init__(self, ikHandle, forearmMidJnt=False, simpleIK=False):
        self.joint1 = pm.listConnections(ikHandle, type='joint')[0]
        self.joint2 = self.joint1.outputs(type='joint')[0]

        if forearmMidJnt:
            self.jointMid = self.joint2.outputs(type='joint')[0]
            self.joint3 = self.jointMid.outputs(type='joint')[0]
        else:
            self.joint3 = self.joint2.outputs(type='joint')[0]

        # FK controls
        orientConstraintFK1 = self.joint1.outputs(type='constraint')[0]

# 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/utils/ikfkSwitch.py
import inspect
import pymel.core as pm
from mayaLib.rigLib.utils import util
    from mayaLib.rigLib.utils import ikfkSwitch

__author__ = 'Lorenzo Argentieri'





class IKFKSwitch():
    def __init__(self, ikHandle, forearmMidJnt=False, simpleIK=False):
        self.joint1 = pm.listConnections(ikHandle, type='joint')[0]
        self.joint2 = self.joint1.outputs(type='joint')[0]

        if forearmMidJnt:
            self.jointMid = self.joint2.outputs(type='joint')[0]
            self.joint3 = self.jointMid.outputs(type='joint')[0]
        else:
            self.joint3 = self.joint2.outputs(type='joint')[0]

        # FK controls
        orientConstraintFK1 = self.joint1.outputs(type='constraint')[0]

        self.joint1FKCtrl = util.getDriverDrivenFromConstraint(orientConstraintFK1)[0][0]