#-------------------------------------------------------------------------------
# Name:        YJ_Leg_Rig
# Purpose:     Rig Legs
#
# Author:      yangjie
#
# Created:     05/07/2014
# Copyright:   (c) yangjie 2014
# Licence:     <your licence>
#-------------------------------------------------------------------------------
from YJ_Rig_Pub import*
from YJ_FK_Rig import*
from YJ_IK_Rig import*
from YJ_Create_Body_Rig_UI_p import*


L_FingerAllList_Lis = YJ_Load_List('L_FingerAllList_Lis.pkl')
R_FingerAllList_Lis = YJ_Get_R_FinLis(L_FingerAllList_Lis)


def YJ_Get_R_FinLis(L_FingerAllList_Lis):
    R_FingerAllList_Lis = []
    for i in L_FingerAllList_Lis:
        R_i = YJ_GetMir_List(i)
        R_FingerAllList_Lis.append(R_i)
    return R_FingerAllList_Lis    

def YJ_Jud_Finger_FK_Rig():
    ZeroGrp_Grp = []
    FingerCtrl_List_Grp = []
    for i in L_FingerAllList_Lis:
        FingerLis = YJ_DuplicateJnt(i,'jnt','FK')
        ZeroCreate = YJRigZeroGrp([FingerLis[0]])
        parent(ZeroCreate,w=True )
        ZeroGrp_Grp.append(ZeroCreate)
        YJ_CreatFkRig(FingerLis[0],FingerLis[-1],1,0)
        ConstrnList = YJ_SetParentConstraint(FingerLis,i)
        YJ_Scale_Shape(FingerLis[:-1],0.1)
        ZeroGrp_Grp.append(ZeroCreate)
        FingerCtrl_List_Grp.append(FingerLis[:-1])
    return  ZeroGrp_Grp, FingerCtrl_List_Grp