#====================================================================================================
#Designer:YangJie
#Email:691633493@
#Version:The First
#====================================================================================================
from maya.cmds import*
#Ctreat window
if window('YJ_GameRig',q=1,ex=1):
        deleteUI('YJ_GameRig',window=1)
window('YJ_GameRig',w=480,h=800,s=1)
##Creat the scroll UI
scrollLayout('YJ_GameRigUI_scrollLayout',hst=16,vst=16)
##Creat the main columnLayout
columnLayout('YJ_GameRigUI_All',adj=1,p='YJ_GameRigUI_scrollLayout')
frameLayout('YJ_FRA_Creat', label='Creat Skeleton', borderStyle='in' ,cll=1,p='YJ_GameRigUI_All',cl=0,w=480)
columnLayout('YJ_CO_C_01',adj=1,p='YJ_FRA_Creat')
###Just Parent The ColumLayout to framLayout
form = formLayout(numberOfDivisions=100,p='YJ_CO_C_01')
b1 = button(label='Import Skeleton',h=22)
op=optionMenu('YJ_Skeleton',h=22)
b2 = op
YJ_Fra =optionMenu( 'YJ_CC_Skeleton',h=22)
formLayout( form, edit=True, 
attachForm=[(b1, 'top', 5), (b1, 'left', 2),
(b2, 'top', 5), 
(YJ_Fra, 'top', 5), (YJ_Fra, 'right', 2) ], 
attachControl=[(b2, 'left', 5, b1), 
(b2, 'right', 2, YJ_Fra)], 
attachPosition=[(b1, 'right', 0, 30),(YJ_Fra, 'left', 2,60)])
####Creat ImportSkeleton Layout with FormLayout
separator( height=5, style='in' ,p='YJ_CO_C_01')
rowLayout('YJ_Export_rowColumnLayout',nc=3,cw3=(160,150,158),p='YJ_CO_C_01')
textField(w=160)
R1=button(label='Export Skeleton To >>',h=22,w=150)
R2=YJ_Export_Skeleton_op=optionMenu( 'YJ_CC_Skeleton',h=22,w=158)
##
separator( height=5, style='in' ,p='YJ_CO_C_01')
columnLayout('YJ_CheckBox_Parent_Layout',adj=1,p='YJ_CO_C_01')
checkBoxGrp('YJ_CheckBox',
cl5=('center','left','left','left','left'),cw5=(100,100,100,100,100),p='YJ_CheckBox_Parent_Layout', numberOfCheckBoxes=4, label='Chose Creat:', labelArray4=['Neck', 'Arm', 'Fingers','Leg'] )
columnLayout('YJ_CheckBox_Parent_Layout',e=1,co=('left',0),p='YJ_CheckBox_Parent_Layout')
separator( height=5, style='in' ,p='YJ_CO_C_01')
rowColumnLayout(nc=8,p='YJ_CO_C_01',cw=[(1,60),(2,50),(3,60),(4,50),(5,60),(6,50),(7,60),(8,50)])
text( label='Spine:',al='center' )
textField(w=45)
text( label='Neck:' ,al='center')
textField(w=45)
text( label='Fingers:' ,al='center')
textField(w=45)
text( label='FingerSeg:',al='center' )
textField(w=45)
separator( height=5, style='in' ,p='YJ_CO_C_01')
separator(p='YJ_CO_C_01',h=10,st='none')
rowLayout('YJ_CreatB_rowColumnLayout',nc=5,cw5=(10,30,60,90,260),p='YJ_CO_C_01')
columnLayout( 'YJ_Extr_None_CoulumnLayout',adj=1 ,p='YJ_CreatB_rowColumnLayout')
columnLayout( 'YJ_Extr_CheckBox_CoulumnLayout',adj=0 ,p='YJ_CreatB_rowColumnLayout')
checkBox( l='' ,p='YJ_Extr_CheckBox_CoulumnLayout',w=20,al='center')
separator(p='YJ_Extr_CheckBox_CoulumnLayout',h=10,st='none')
checkBox( l='' ,p='YJ_Extr_CheckBox_CoulumnLayout',w=20,al='center')
separator(p='YJ_Extr_CheckBox_CoulumnLayout',h=10,st='none')
checkBox( l='' ,p='YJ_Extr_CheckBox_CoulumnLayout',w=20,al='center')
columnLayout( 'YJ_Extr_Text_CoulumnLayout',w=60,adjustableColumn=0 ,p='YJ_CreatB_rowColumnLayout')
text(l='Tail:',al='right',w=60)
separator(p='YJ_Extr_Text_CoulumnLayout',h=10,st='none')
text(l='Nub of Arm:',al='right',w=60)
separator(p='YJ_Extr_Text_CoulumnLayout',h=10,st='none')
text(l='Nub of Leg:',al='right',w=60)
columnLayout( 'YJ_Extr_TextField_CoulumnLayout',adjustableColumn=0,p='YJ_CreatB_rowColumnLayout' )
textField(h=20,w=90)
separator(p='YJ_Extr_TextField_CoulumnLayout',h=4,st='none')
textField(h=20,w=90)
separator(p='YJ_Extr_TextField_CoulumnLayout',h=4,st='none')
textField(h=20,w=90)
columnLayout( 'YJ_Extr_Button_CoulumnLayout',w=255,adjustableColumn=1,p='YJ_CreatB_rowColumnLayout')
button(label='Creat   Skeleton',h=32,w=255)
separator(p='YJ_Extr_Button_CoulumnLayout',h=5,st='none')
button(label='Rebuild Skeleton',h=32,w=255)

frameLayout('YJ_RigAndExport', label='Rig And Export', borderStyle='in' ,cll=1,p='YJ_GameRigUI_All',cl=1,w=480)
columnLayout( 'YJ_RigAndExport_Under_columnLayout',adjustableColumn=1,p='YJ_RigAndExport',w=60 )
rowLayout('YJ_GameRig_rowColumnLayout',nc=3,cw3=(60,40,300),p='YJ_RigAndExport_Under_columnLayout')
##Creat the rig chosename columnlayout
columnLayout( 'YJ_GameRig_CoulumnLayout',adjustableColumn=1,p='YJ_GameRig_rowColumnLayout',w=60 )
text(l='Neck:',al='right',w=60)
separator(p='YJ_GameRig_CoulumnLayout',h=10,st='none')
text(l='Spine:',al='right',w=60)
separator(p='YJ_GameRig_CoulumnLayout',h=10,st='none')
text(l='Arm:',al='right',w=60)
separator(p='YJ_GameRig_CoulumnLayout',h=10,st='none')
text(l='Leg:',al='right',w=60)
separator(p='YJ_GameRig_CoulumnLayout',h=10,st='none')
text(l='Tail:',al='right',w=60)
##Creat empty columnlayout
columnLayout( 'YJ_GameRig_Empty_CoulumnLayout',adjustableColumn=1,p='YJ_GameRig_rowColumnLayout',w=40 )
##Creat rig chose  columnlayout
##NeckChose
columnLayout( 'YJ_GameRig_Chose_CoulumnLayout',adjustableColumn=1 ,p='YJ_GameRig_rowColumnLayout')
rowLayout('YJ_GameRig_NeckChose_rowColumnLayout',nc=3,cw3=(120,120,120),p='YJ_GameRig_Chose_CoulumnLayout')
radioCollection('YJ_GameRig_NeckChose_radioCollection',p='YJ_GameRig_NeckChose_rowColumnLayout')
radioButton( 'YJ_GameRig_NeckChose_SplineIK',label='SplineIK' )
radioButton('YJ_GameRig_NeckChose_FK', label='FK' )
radioButton( 'YJ_GameRig_NeckChose_IKFK',label='IKFK' )
radioCollection('YJ_GameRig_NeckChose_radioCollection',e=1,sl='YJ_GameRig_NeckChose_IKFK')
##SpineChose
separator(p='YJ_GameRig_Chose_CoulumnLayout',h=10,st='none')
rowLayout('YJ_GameRig_SpineChose_rowColumnLayout',nc=3,cw3=(120,120,120),p='YJ_GameRig_Chose_CoulumnLayout')
radioCollection('YJ_GameRig_SpineChose_radioCollection',p='YJ_GameRig_SpineChose_rowColumnLayout')
radioButton('YJ_GameRig_SpineChose_SplineIK', label='SplineIK' )
radioButton( 'YJ_GameRig_SpineChose_FK',label='FK' )
radioButton( 'YJ_GameRig_SpineChose_IKFK',label='IKFK' )
radioCollection('YJ_GameRig_SpineChose_radioCollection',e=1,sl='YJ_GameRig_SpineChose_IKFK')
##ArmChose
separator(p='YJ_GameRig_Chose_CoulumnLayout',h=10,st='none')
rowLayout('YJ_GameRig_ArmChose_rowColumnLayout',nc=3,cw3=(120,120,120),p='YJ_GameRig_Chose_CoulumnLayout')
radioCollection('YJ_GameRig_ArmChose_radioCollection',p='YJ_GameRig_ArmChose_rowColumnLayout')
radioButton('YJ_GameRig_ArmChose_IK', label='IK' )
radioButton('YJ_GameRig_ArmChose_FK',  label='FK' )
radioButton( 'YJ_GameRig_ArmChose_IKFK',label='IKFK' )
radioCollection('YJ_GameRig_ArmChose_radioCollection',e=1,sl='YJ_GameRig_ArmChose_IKFK')
##LegChose
separator(p='YJ_GameRig_Chose_CoulumnLayout',h=10,st='none')
rowLayout('YJ_GameRig_LegChose_rowColumnLayout',nc=3,cw3=(120,120,120),p='YJ_GameRig_Chose_CoulumnLayout')
radioCollection('YJ_GameRig_LegChose_radioCollection',p='YJ_GameRig_LegChose_rowColumnLayout')
radioButton('YJ_GameRig_LegChose_IK', label='IK' )
radioButton( 'YJ_GameRig_LegChose_FK',label='FK' )
radioButton('YJ_GameRig_LegChose_IKFK', label='IKFK' )
radioCollection('YJ_GameRig_LegChose_radioCollection',e=1,sl='YJ_GameRig_LegChose_IKFK')
##TailChose
separator(p='YJ_GameRig_Chose_CoulumnLayout',h=10,st='none')
rowLayout('YJ_GameRig_TailChose_rowColumnLayout',nc=3,cw3=(120,120,120),p='YJ_GameRig_Chose_CoulumnLayout')
radioCollection('YJ_GameRig_TailChose_radioCollection',p='YJ_GameRig_TailChose_rowColumnLayout')
radioButton('YJ_GameRig_TailChose_SplineIK', label='SplineIK' )
radioButton('YJ_GameRig_TailChose_FK',label='FK' )
radioButton('YJ_GameRig_TailChose_IKFK',label='IKFK' )
radioCollection('YJ_GameRig_TailChose_radioCollection',e=1,sl='YJ_GameRig_TailChose_IKFK')
separator( height=5, style='in' ,p='YJ_RigAndExport_Under_columnLayout')
columnLayout( 'YJ_Rig_CoulumnLayout',adjustableColumn=1 ,p='YJ_RigAndExport_Under_columnLayout')
button(l='Rigging',h=30)
##Creat the export rowlayout
separator( height=8, style='in' ,p='YJ_RigAndExport_Under_columnLayout')
rowLayout('YJ_GameRig_Export_rowColumnLayout',nc=3,cw3=(180,150,120),p='YJ_RigAndExport_Under_columnLayout')
text(l='\tRoot Location:')
radioCollection('YJ_GameRig_Export_radioCollection',p='YJ_GameRig_TailChose_rowColumnLayout')
radioButton('YJ_GameRig_Export_Word Origin',label='Word Origin' )
radioButton('YJ_GameRig_Export_Center',label='Center' )
radioCollection('YJ_GameRig_Export_radioCollection',e=1,sl='YJ_GameRig_Export_Center')
##Creat the columnLayout for the export button
columnLayout( 'YJ_CreatSkinJonit_CoulumnLayout',adjustableColumn=1 ,p='YJ_RigAndExport_Under_columnLayout')
button(l='Creat Skin Joint For Export',h=30)
showWindow()