#!/usr/bin/env python
#coding=cp936
#coding=utf-8
#--author-- : yujing
#--date-- : 2017.7.21
####### ---- "Ring_Tool" ---- ############# 
import maya.cmds as cmds
import maya.mel as mel
class AR_optionwindow (object):
    
    @classmethod
    def showUI(cls):
        win = cls()
        win.create()
        return win
    def __init__ (self):
        self.window = 'ar_optionwindow '
        self.title = '设置工具架'
        self.size = (546,350)
        self.supportsToolAction = False
    def creat(self):
        if cmds.window('optionWin',exists = 1):
            cmds.deleteUI('optionWin')
        self.window = cmds.window('optionWin',title = self.title,widthHeight = self.size, menuBar = True, resizeToFitChildren=True)
        tabs = cmds.tabLayout(innerMarginWidth=5, innerMarginHeight=5)
        child1 = cmds.frameLayout('frameLayout_1',label='属性工具架_A', borderStyle='in',cll =1,bgc=(0.5,0.2,0))
        cmds.rowColumnLayout('rowColumnLayout_1',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='Ctrl Color',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/changeColorTool.mel\"\')')
        cmds.button(label='中心轴锁定隐藏',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/pivot_lock.mel\"\')')
        cmds.button(label='锁定并隐藏所有属性',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/open_close_tool.mel\"\')')
        cmds.button(label='去除空间命名',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/removeNameSpace.mel\"\')')
        cmds.button(label='重命名工具',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/rename.py\")')
        cmds.button(label='多物体属性属性关联',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/Attr_Link.mel\"\')')
        cmds.button(label='驱动工具',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/drivenTool.mel\"\')')
        cmds.button(label='Blend反算工具',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/correctiveShapeCmd.py\")')
        cmds.button(label='驱动关键帧镜像工具',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/common/mirrorDrivenKey.py\")')
        cmds.setParent( tabs )
        tab2=cmds.columnLayout(adj=True)
        child2 = cmds.frameLayout('frameLayout_2',label='控制器工具架_A', borderStyle='in',cll =1,bgc=(0.2,0.2,0.6) )
        cmds.rowColumnLayout('rowColumnLayout_2',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='创建控制器',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/controlMaker.mel\"\')')
        cmds.button(label='道具总控创建',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/Pro_Ctrl.py\")')
        cmds.button(label='添加自动化表达式',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/addExpression.mel\"\')')
        cmds.button(label='软选创建控制器',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/softCreateCtrl.py\")')
        cmds.button(label='创建线性IK（拉伸）工具',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/IkCurStretch.py\")')
        cmds.setParent( '..' )
        child2_1 = cmds.frameLayout('frameLayout_2_1',label='骨骼创建工具架_B', borderStyle='in',cll =1,bgc=(0.2,0.2,0.6) )
        cmds.rowColumnLayout('rowColumnLayout_2',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='添加等距骨骼',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/add_equality_joint.mel\"\')')
        cmds.button(label='创建控制骨骼跟随曲线',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/C_ctrlOnCurve.mel\"\')')
        cmds.button(label='创建骨骼跟随曲线',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/C_jointOnCurve.mel\"\')')
        cmds.button(label='曲线创建物体',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/create/Createobj.mel\"\')')
        cmds.setParent( tabs )
        tab3=cmds.columnLayout(adj=True)
        child3 = cmds.frameLayout('frameLayout_3',label='权重工具架_A', borderStyle='in',cll =1,bgc=(0.3,0.4,0) )
        cmds.rowColumnLayout('rowColumnLayout_3',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='拷贝权重工具',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/CopySkinWeightJoints.mel\"\')')
        cmds.button(label='模型替换权重工具',w=125,h=50,c='execfile("O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/MatchingMesh.py")')
        cmds.button(label='选择蒙皮骨骼',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/selectSkinJoints.mel\"\')')
        cmds.button(label='骨骼链缩放关联',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/jointScale.mel\"\')')
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        child3_1 = cmds.frameLayout('frameLayout_3_1',label='次级工具架_B', borderStyle='in',cll =1,bgc=(0.3,0.4,0) )
        cmds.rowColumnLayout('rowColumnLayout_3_1',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='次级控制',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/lz_subCtl_UI.mel\"\')')
        cmds.button(label='簇工具',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/clusterTool_old.mel\"\')')
        cmds.button(label='Poly点添加毛囊',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/YY_HUV.mel\"\')')
        cmds.button(label='模型上加柳钉（选点）',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/polyAttach.py\")')
        cmds.button(label='铆钉工具（选择两根线）',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/edit/Add_locator.mel\"\')')
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        child4 = cmds.frameLayout('frameLayout_4',label='角色工具架_A', borderStyle='in',cll =1,bgc=(0.1,0.2,0.4))
        cmds.rowColumnLayout('rowColumnLayout_4',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='Smooth控制器添加',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/character/smooth_connectAttr.py\")')
        cmds.button(label='毛发关联（hair/yeti）',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/character/allHairConnect.py\")')
        cmds.button(label='角色变体贴图切换工具',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/character/texChangeTool.py\")')
        cmds.button(label='adv表情设置新增控制器',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/character/advFaceCtrlAdd.py\")')
        cmds.button(label='SJ设置工具集',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/character/SJ_RiggingTool.py\")')
        cmds.button(label='裙子设置Adv',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/character/dressRig_adv.mel\"\')')
        cmds.button(label='添加辅助骨骼',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/character/AddOptionJointTool.py\")')
        cmds.button(label='表情融合工具',w=125,h=50,c="import edward.showUi;reload(edward.showUi)")
        cmds.setParent( tabs )
       	tab5=cmds.columnLayout(adj=True)
        child5 = cmds.frameLayout('frameLayout_5',label='动画检查工具架_A', borderStyle='in',cll =1,bgc=(0,0.5,0.5) )
        cmds.rowColumnLayout('rowColumnLayout_5',nc=1,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='设置检查工具',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/check/stateRiggingCheck.py\")')
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        child5_1 = cmds.frameLayout('frameLayout_5_1',label='动补检查工具架_B', borderStyle='in',cll =1,bgc=(0,0.5,0.5) )
        cmds.rowColumnLayout('rowColumnLayout_5_1',nc=1,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='敬请期待',w=125,h=50)
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        child5_2= cmds.frameLayout('frameLayout_5_2',label='群集Miarmy检查工具架_C', borderStyle='in',cll =1,bgc=(0,0.5,0.5) )
        cmds.rowColumnLayout('rowColumnLayout_5_2',nc=1,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='敬请期待',w=125,h=50)
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        cmds.setParent( tabs )
        tab6=cmds.columnLayout(adj=True)
        child6 = cmds.frameLayout('frameLayout_6',label='骨骼对位工具架_A', borderStyle='in',cll =1,bgc=(0.1,0.2,0.2) )
        cmds.rowColumnLayout('rowColumnLayout_6',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='动捕forMB骨骼对位',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/other/jointChainLocater/MocapCharacter_jnt_adv.mel\"\')')
        cmds.button(label='群集Miarmy骨骼对位',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/other/jointChainLocater/qunji_jnt_adv.mel\"\')')
        cmds.button(label='获取关键帧范围',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/other/listFrameRange.mel\"\')')
        cmds.button(label='动捕转换工具（tsm）',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/other/motionCaptureConvertTool.mel\"\')')
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        child6_1 = cmds.frameLayout('frameLayout_6_1',label='肌肉工具架_B', borderStyle='in',cll =1,bgc=(0.1,0.2,0.2) )
        cmds.rowColumnLayout('rowColumnLayout_6_1',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='OpenMayaMuscle2013',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/other/muscleSys/New_OpenMayaMuscle2013.mel\"\')')
        cmds.button(label='OpenMayaMuscle2015',w=125,h=50,c='mel.eval(\'source \"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/other/muscleSys/New_OpenMayaMuscle2015.mel\"\')')
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        child6_2 = cmds.frameLayout('frameLayout_6_2',label='翅膀系统_C', borderStyle='in',cll =1,bgc=(0.1,0.2,0.2))
        cmds.rowColumnLayout('rowColumnLayout_6_2',nc=3,cat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)],rat=[(1,'both',10),(2,'both',10),(3,'both',10),(4,'both',10)])
        cmds.button(label='创建翅膀系统',w=125,h=50,c='execfile(\"O:/hq_tool/Maya/hq_maya/scripts/fantabox/rigging/other/wingSys/PlumeUI.py\")')
        cmds.setParent( '..' )
        cmds.setParent( '..' )
        cmds.tabLayout( tabs, edit=True,tabLabel=((child1, '常用工具栏'), (tab2, '设置创建栏'),(tab3, '修改编辑栏'),(child4, '角色相关栏'),(tab5, '检查工具栏'),(tab6, '其他相关栏')))
        cmds.showWindow()

#def main():
if __name__=='__main__':
                 
    a = AR_optionwindow()
    a.creat()