#-------------------------------------------------------------------------------
# Name: YJ_FK_RIG
# Purpose: Create_IKFK_RIG
#
# Author: YangJie
#
# Created: 08/04/2014
#Email: 691633493@
#-------------------------------------------------------------------------------
from maya.cmds import*
import maya.mel as mm
from YJ_Ctrl_Colour import*
from YJ_ParentShape import*
from YJ_IKFK_RIG_UI import*
from YJ_NameTool import*
from YJ_Rig_Pub import*
def YJ_CreatFkRig(StarBaseJnt,EndBaseJnt,judge,dubjud):
StarBaseJnt,EndBaseJnt = YJ_judge_get_jnt(StarBaseJnt,EndBaseJnt,judge)
AllBaseJntList_O=YJ_GetBaseJntList(StarBaseJnt,EndBaseJnt)
YJ_Fk_shape(AllBaseJntList_O)
YJ_CreatFkLength(AllBaseJntList_O)
YJ_LockAndHideAttr(AllBaseJntList_O,['tx','ty','tz','sx','sy','sz','v','radi'],1,0)
def YJ_judge_get_jnt(StarBaseJnt,EndBaseJnt,judge):
if judge == 1:
StarBaseJnt,EndBaseJnt = StarBaseJnt,EndBaseJnt
elif judge == 0:
StarBaseJnt = textField('FK_star_tf',q=1 ,tx = 1)
EndBaseJnt = textField('FK_end_tf',q=1 ,tx = 1)
return StarBaseJnt,EndBaseJnt
def YJ_Fk_shape(InJntLis):
for i in InJntLis[:-1]:
CurveName=i+'Curve'
YJ_Creat_Ctrl("Cur5",CurveName)
YJ_Parent_Shape(CurveName,i,0,0)
def YJ_CreatFkLength(InJntList):
for i in InJntList[:-1]:
addAttr( i,longName='length', attributeType='double',dv=1,k=1)
ChrJnt=listRelatives(i,c=1,typ='joint')[0]
length=getAttr(ChrJnt+'.tx')
shadingNode('multiplyDivide',asUtility=1,n=i+'_MD')
setAttr('%s.input2X'%(i+'_MD'),length)
connectAttr('%s.length'%i,'%s.input1X'%(i+'_MD'),f=1)
connectAttr('%s.outputX'%(i+'_MD'),'%s.tx'%ChrJnt,f=1)