# Path: mayaLib/pipelineLib/utility/nameCheck.py
# def nameCheck(name):
#     """
#     Return new univocal Name
#     :param name: str
#     :return: str
#     """
#     nameList = pm.ls(name)
#     nameCount = len(nameList)
# 
#     newNameRPart = str(name).rpartition('_')
#     newName = newNameRPart[0].replace('*', '') + str(nameCount + 1) + newNameRPart[1] + newNameRPart[2]
#     return newName
# 
# 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/shaderLib/base/shader_base.py
# def build_lambert(shaderType='lambert', shaderName='tmp-shader', color=(0.5, 0.5, 0.5), transparency=(0.0, 0.0, 0.0)):
# def build_surfaceshader(shaderType='surfaceShader', shaderName='tmp-shader', color=(0.5, 0.5, 0.5)):
# def assign_shader(geo, shader):
#     def __init__(self, shader_name, shader_type='aiStandard'):
#     def get_shader(self):
#     def assign_shader(self, geo):
#     def connect_color_texture(self, file_node, slot_name):
#     def connect_luminance_texture(self, file_node, slot_name):
#     def connect_fresnel(self, file_node, slot_name):
#     def connect_normal(self, file_node, slot_name):
# class Shader_base():


from string import ascii_letters as letters
from mayaLib.pipelineLib.utility import nameCheck
from mayaLib.rigLib.utils import util
from mayaLib.shaderLib.base import shader_base
import pymel.core as pm
        fp_curve = pm.curve(d=2,
                            p=[(-5, 0, -5), (0, 0, -5), (5, 0, -5)],
                            k=[0, 0, 1, 1],
                            n='%s_wire_CV' % (fp_name))
        cl_a, cl_b, cl_mid = self.cluster_curve(fp_curve, fp_name)

        # create and place twist deformer
        pm.select(fp_bshp)
        fp_twist = pm.nonLinear(type='twist', lowBound=-1, highBound=1)
        # displays warning: pymel.core.general : could not create desired mfn. Defaulting MfnDependencyNode.
        # doesn't seem to affect anything though
        pm.rename(fp_twist[0], '%s_twistAttr_surface_NURBS' % (fp_name))
        pm.rename(fp_twist[1], '%s_twist_Handle_DEFORMER' % (fp_name))
        fp_twist[1].rz.set(90)
        # connect start and end angle to their respective control
        connect = self.ctrl_b.rx >> fp_twist[0].startAngle
        connect = self.ctrl_a.rx >> fp_twist[0].endAngle

        # skins wire to blendshape
        fp_wire = pm.wire(fp_bshp, w=fp_curve, gw=False, en=1, ce=0, li=0,  # dds=(0, 20),
                          n='%s_wireAttrs_DEFORMER' % (fp_name))
        fp_wire[0].dropoffDistance[0].set(20)
        hist = pm.listHistory(fp_surf)
        tweaks = [t for t in hist if 'tweak' in t.nodeName()]
        pm.rename(tweaks[2], '%s_cl_cluster_tweak' % (fp_name))
        pm.rename(tweaks[0], '%s_wireAttrs_tweak' % (fp_name))
        pm.rename(tweaks[1], '%s_extra_tweak' % (fp_name))

        # group clusters
        cl_grp = pm.group(cl_a[1], cl_b[1], cl_mid[1], n='%s_cls_GRP' % (fp_name))

# Path: mayaLib/pipelineLib/utility/nameCheck.py
# def nameCheck(name):
#     """
#     Return new univocal Name
#     :param name: str
#     :return: str
#     """
#     nameList = pm.ls(name)
#     nameCount = len(nameList)
# 
#     newNameRPart = str(name).rpartition('_')
#     newName = newNameRPart[0].replace('*', '') + str(nameCount + 1) + newNameRPart[1] + newNameRPart[2]
#     return newName
# 
# 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/shaderLib/base/shader_base.py
# def build_lambert(shaderType='lambert', shaderName='tmp-shader', color=(0.5, 0.5, 0.5), transparency=(0.0, 0.0, 0.0)):
# def build_surfaceshader(shaderType='surfaceShader', shaderName='tmp-shader', color=(0.5, 0.5, 0.5)):
# def assign_shader(geo, shader):
#     def __init__(self, shader_name, shader_type='aiStandard'):
#     def get_shader(self):
#     def assign_shader(self, geo):
#     def connect_color_texture(self, file_node, slot_name):
#     def connect_luminance_texture(self, file_node, slot_name):
#     def connect_fresnel(self, file_node, slot_name):
#     def connect_normal(self, file_node, slot_name):
# class Shader_base():


# Path: mayaLib/rigLib/utils/flexiplane.py
from string import ascii_letters as letters
from mayaLib.pipelineLib.utility import nameCheck
from mayaLib.rigLib.utils import util
from mayaLib.shaderLib.base import shader_base
import pymel.core as pm

        fp_curve = pm.curve(d=2,
                            p=[(-5, 0, -5), (0, 0, -5), (5, 0, -5)],
                            k=[0, 0, 1, 1],
                            n='%s_wire_CV' % (fp_name))
        cl_a, cl_b, cl_mid = self.cluster_curve(fp_curve, fp_name)

        # create and place twist deformer
        pm.select(fp_bshp)
        fp_twist = pm.nonLinear(type='twist', lowBound=-1, highBound=1)
        # displays warning: pymel.core.general : could not create desired mfn. Defaulting MfnDependencyNode.
        # doesn't seem to affect anything though
        pm.rename(fp_twist[0], '%s_twistAttr_surface_NURBS' % (fp_name))
        pm.rename(fp_twist[1], '%s_twist_Handle_DEFORMER' % (fp_name))
        fp_twist[1].rz.set(90)
        # connect start and end angle to their respective control
        connect = self.ctrl_b.rx >> fp_twist[0].startAngle
        connect = self.ctrl_a.rx >> fp_twist[0].endAngle

        # skins wire to blendshape
        fp_wire = pm.wire(fp_bshp, w=fp_curve, gw=False, en=1, ce=0, li=0,  # dds=(0, 20),
                          n='%s_wireAttrs_DEFORMER' % (fp_name))
        fp_wire[0].dropoffDistance[0].set(20)
        hist = pm.listHistory(fp_surf)
        tweaks = [t for t in hist if 'tweak' in t.nodeName()]
        pm.rename(tweaks[2], '%s_cl_cluster_tweak' % (fp_name))
        pm.rename(tweaks[0], '%s_wireAttrs_tweak' % (fp_name))
        pm.rename(tweaks[1], '%s_extra_tweak' % (fp_name))

        # group clusters
        cl_grp = pm.group(cl_a[1], cl_b[1], cl_mid[1], n='%s_cls_GRP' % (fp_name))

        util.lock_and_hide_all(cl_grp)