#====================================================================================================
#CreateCurvesAndSave
#
#Designer:YangJie
#Email:691633493@
#Version:2.2
#====================================================================================================
from maya.cmds import*
from YJ_ZeroGrp import*
from YJ_ParentShape import*
import glob,os
import getpass
PicPath='E:\\YJ_maya_srcipt\\prefs\\icons\\CurIcon\\'
ClassTxt='E:\\YJ_maya_srcipt\\prefs\\icons\\CurIcon\\CurveClass.dat'
def YJ_Ctrl_Colour():
#Ctreat window
#
PicJudge=os.path.exists(PicPath)
ClassJudge=os.path.exists(ClassTxt)
if PicJudge != 1:
os.makedirs(PicPath)
if ClassJudge != 1:
ClassCreate=open(ClassTxt,'w')
ClassCreate.close()
YJ_CurNameAndSaveImg()
#
BaseClass={'Cur6': [3, [(0.0, 0.0, 0.0), (0.0, 2.7000000000000002, 0.0), (0.0, 3.0, 0.0), (0.0, 3.0, 0.0060000000000000001), (0.0, 3.0, 0.28200000000000003), (0.0, 3.3240000000000003, 1.1459999999999999), (0.0, 4.4820000000000002, 1.6680000000000001), (0.0, 5.6760000000000002, 1.1760000000000002), (0.0, 6.161999999999999, 0.0), (0.0, 5.6760000000000002, -1.1819999999999999), (0.0, 4.6560000000000006, -1.6620000000000001), (0.0, 3.2160000000000002, -1.23), (0.0, 3.024, -0.312), (0.0, 2.9939999999999998, 0.0)], [0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 11.0, 11.0]], 'Cur7': [1, [(0.0, 3.0, 0.0), (0.0, -3.0, 0.0), (0.0, 0.0, 0.0), (-3.0, 0.0, 0.0), (3.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 3.0), (0.0, 0.0, -3.0)]], 'Cur4': [1, [(-3.0, 0.0, -3.0), (-3.0, 0.0, 3.0), (3.0, 0.0, 3.0), (3.0, 0.0, -3.0), (-3.0, 0.0, -3.0)]], 'Cur5': [3, [(1.1102230246251565e-016, 1.8369701987210297e-016, -3.0), (-0.7836116248912246, 1.8369701987210299e-016, -3.0), (-2.3508348746736729, 1.4394712022965415e-016, -2.3508348746736729), (-3.3245825626631635, 5.899006384856358e-032, -9.6338085217116898e-016), (-2.3508348746736734, -1.4394712022965408e-016, 2.350834874673672), (-1.0017616090771558e-015, -2.0357196969332743e-016, 3.3245825626631644), (2.3508348746736716, -1.4394712022965415e-016, 2.3508348746736729), (3.3245825626631635, -1.0933890203714376e-031, 1.7856397797841755e-015), (2.3508348746736751, 1.4394712022965405e-016, -2.3508348746736716), (0.78361162489122493, 1.8369701987210297e-016, -2.9999999999999991), (2.2204460492503131e-016, 1.8369701987210299e-016, -2.9999999999999996)], [0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.0, 8.0]], 'Cur2': [1, [(0.0, 0.0, -3.0), (-2.0, 0.0, -1.0), (-1.0, 0.0, -1.0), (-1.0, 0.0, 2.0), (1.0, 0.0, 2.0), (1.0, 0.0, -1.0), (2.0, 0.0, -1.0), (0.0, 0.0, -3.0)]], 'Cur3': [1, [(0.0, 0.0, -3.0), (-1.2000000000000002, 0.0, -1.7999999999999998), (-0.60000000000000009, 0.0, -1.7999999999999998), (-0.60000000000000009, 0.0, -0.60000000000000009), (-1.7999999999999998, 0.0, -0.60000000000000009), (-1.7999999999999998, 0.0, -1.2000000000000002), (-3.0, 0.0, 0.0), (-1.7999999999999998, 0.0, 1.2000000000000002), (-1.7999999999999998, 0.0, 0.60000000000000009), (-0.60000000000000009, 0.0, 0.60000000000000009), (-0.60000000000000009, 0.0, 1.7999999999999998), (-1.2000000000000002, 0.0, 1.7999999999999998), (0.0, 0.0, 3.0), (1.2000000000000002, 0.0, 1.7999999999999998), (0.60000000000000009, 0.0, 1.7999999999999998), (0.60000000000000009, 0.0, 0.60000000000000009), (1.7999999999999998, 0.0, 0.60000000000000009), (1.7999999999999998, 0.0, 1.2000000000000002), (3.0, 0.0, 0.0), (1.7999999999999998, 0.0, -1.2000000000000002), (1.7999999999999998, 0.0, -0.60000000000000009), (0.60000000000000009, 0.0, -0.60000000000000009), (0.60000000000000009, 0.0, -1.7999999999999998), (1.2000000000000002, 0.0, -1.7999999999999998), (0.0, 0.0, -3.0)]], 'Cur0': [1, [(-3.0, -3.0, 3.0), (-3.0, 3.0, 3.0), (-3.0, 3.0, -3.0), (-3.0, -3.0, -3.0), (-3.0, -3.0, 3.0), (3.0, -3.0, 3.0), (3.0, 3.0, 3.0), (-3.0, 3.0, 3.0), (-3.0, 3.0, -3.0), (3.0, 3.0, -3.0), (3.0, 3.0, 3.0), (3.0, -3.0, 3.0), (3.0, -3.0, -3.0), (3.0, 3.0, -3.0), (-3.0, 3.0, -3.0), (-3.0, -3.0, -3.0), (3.0, -3.0, -3.0), (3.0, -3.0, 3.0), (-3.0, -3.0, 3.0), (-3.0, -3.0, -3.0)]], 'Cur1': [3, [(-3.0, 8.3266726846886741e-017, 6.6613381477509392e-016), (-2.9999999999999996, -0.78361162489122416, 7.9214817502884282e-016), (-2.3508348746736729, -2.3508348746736729, 9.0003328175214818e-016), (-0.7836116248912246, -3.0, 6.564335285666249e-016), (6.6613381477509392e-016, -3.0000000000000009, 1.4988010832439613e-015), (7.1411618818497882e-016, -3.0000000000000013, -0.7836116248912226), (6.6593732122055569e-016, -2.3508348746736751, -2.3508348746736716), (3.5769375353573681e-016, -0.78361162489122482, -2.9999999999999996), (8.3266726846886741e-017, 1.8369701987210297e-016, -3.0), (-0.7836116248912246, 1.8369701987210302e-016, -3.0), (-2.3508348746736729, 1.4394712022965418e-016, -2.3508348746736729), (-3.0, 4.798237340988475e-017, -0.78361162489122504), (-3.0, 0.0, -9.1593399531575415e-016), (-3.0, 0.78361162489122438, 5.4011945452134493e-016), (-2.3508348746736734, 2.350834874673672, 1.4394712022965418e-016), (-0.78361162489122527, 2.9999999999999996, -3.0844006123935721e-016), (-5.8286708792820718e-016, 3.0, -4.82436794902991e-016), (-6.1815144136520913e-016, 3.0, -0.78361162489122504), (-3.7804308076124699e-016, 2.3508348746736729, -2.3508348746736729), (9.7002862084692221e-018, 0.7836116248912246, -3.0), (8.3266726846886741e-017, 1.8369701987210297e-016, -3.0), (0.78361162489122482, 1.8369701987210294e-016, -2.9999999999999996), (2.3508348746736751, 1.4394712022965403e-016, -2.3508348746736716), (3.0000000000000013, 4.7982373409884602e-017, -0.7836116248912226), (3.0000000000000009, -1.4791141972893971e-031, 1.4988010832439613e-015), (2.9999999999999996, -4.7982373409884824e-017, 0.7836116248912256), (2.3508348746736716, -1.4394712022965418e-016, 2.3508348746736729), (0.78361162489122305, -1.8369701987210307e-016, 3.0000000000000009), (-1.8369701987210324e-016, 1.0824674490095276e-015, 3.0), (-3.5769375353573696e-016, 0.78361162489122527, 3.0), (-6.6593732122055539e-016, 2.3508348746736734, 2.350834874673672), (-7.1411618818497853e-016, 3.0, 0.78361162489122349), (-5.8286708792820718e-016, 3.0, -4.82436794902991e-016), (0.78361162489122416, 3.0, -6.564335285666247e-016), (2.3508348746736747, 2.350834874673672, -9.0003328175214858e-016), (3.0000000000000013, 0.78361162489122327, -7.9214817502884282e-016), (3.0000000000000009, -8.3266726846886721e-016, -6.6613381477509373e-016), (3.0, -0.78361162489122493, -5.4011945452134453e-016), (2.350834874673672, -2.3508348746736725, -1.4394712022965381e-016), (0.78361162489122371, -3.0000000000000009, 3.084400612393576e-016), (6.6613381477509392e-016, -3.0000000000000009, 1.4988010832439613e-015), (6.1815144136520903e-016, -2.9999999999999996, 0.7836116248912256), (3.7804308076124669e-016, -2.3508348746736716, 2.3508348746736729), (-9.7002862084695549e-018, -0.78361162489122305, 3.0000000000000009), (-1.8369701987210324e-016, 1.0824674490095276e-015, 3.0), (-0.78361162489122527, -1.8369701987210297e-016, 3.0), (-2.3508348746736734, -1.439471202296541e-016, 2.350834874673672), (-3.0, -4.7982373409884676e-017, 0.78361162489122349), (-3.0, 0.0, -7.4940054162198066e-016)], [8.0, 8.0, 8.0, 9.0, 10.0, 10.0, 10.0, 11.0, 12.0, 12.0, 12.0, 13.0, 14.0, 14.0, 14.0, 15.0, 16.0, 16.0, 16.0, 17.0, 18.0, 18.0, 18.0, 19.0, 20.0, 20.0, 20.0, 21.0, 22.0, 22.0, 22.0, 23.0, 24.0, 24.0, 24.0, 25.0, 26.0, 26.0, 26.0, 27.0, 28.0, 28.0, 28.0, 29.0, 30.0, 30.0, 30.0, 31.0, 32.0, 32.0, 32.0]], 'Cur8': [1, [(-3.0, 0.0, -3.0), (3.0, 0.0, -3.0), (3.0, 0.0, 3.0), (-3.0, 0.0, 3.0), (-3.0, 0.0, -3.0), (0.0, 6.0, 0.0), (3.0, 0.0, -3.0), (3.0, 0.0, 3.0), (0.0, 6.0, 0.0), (-3.0, 0.0, 3.0)]], 'Cur9': [3, [(0.84000000000000008, 0.0, -2.7000000000000002), (1.478202, 0.0, -1.6834500000000001), (1.445058, 0.0, -0.18092819999999998), (1.478202, 0.0, 1.1006339999999999), (1.4534699999999998, 0.0, 1.8413759999999999), (1.1936939999999998, 0.0, 2.1164339999999999), (0.92628599999999994, 0.0, 1.8413759999999999), (0.92628599999999994, 0.0, 0.87868799999999991), (0.8880840000000001, 0.0, 0.1452156), (0.83460000000000001, 0.0, -0.0075910199999999995), (0.78111599999999992, 0.0, 0.160497), (0.85751999999999995, 0.0, 2.0094660000000002), (0.89572200000000002, 0.0, 2.559552), (0.62066999999999994, 0.0, 2.7811380000000003), (0.36200759999999998, 0.0, 2.4968940000000002), (0.37603920000000002, 0.0, 1.9497600000000002), (0.28484520000000002, 0.0, 0.3012918), (0.221715, 0.0, -0.0003428886), (0.2076858, 0.0, 0.37845419999999996), (0.24275759999999999, 0.0, 1.998864), (0.24977340000000003, 0.0, 2.8757100000000002), (0.004258062, 0.0, 3.0580860000000003), (-0.2973768, 0.0, 2.8897200000000001), (-0.33244859999999998, 0.0, 1.9848239999999999), (-0.4025976, 0.0, 0.39949679999999999), (-0.45170100000000002, 0.0, 0.069805800000000001), (-0.47274360000000004, 0.0, 0.39949679999999999), (-0.45170100000000002, 0.0, 2.005884), (-0.45170100000000002, 0.0, 2.5670519999999999), (-0.68318400000000001, 0.0, 2.7283979999999999), (-0.97780200000000006, 0.0, 2.6371859999999998), (-1.0058639999999999, 0.0, 1.079928), (-1.0339260000000001, 0.0, 0.15398099999999998), (-1.531968, 0.0, -0.89823000000000008), (-1.9247939999999999, 0.0, -0.35107920000000004), (-2.4088080000000001, 0.0, -0.077505000000000004), (-2.920884, 0.0, -0.11959260000000001), (-2.9980440000000002, 0.0, -0.3370494), (-2.9349119999999997, 0.0, -0.50540279999999993), (-2.492988, 0.0, -0.79300800000000005), (-2.2615020000000001, 0.0, -1.1718), (-1.6582319999999999, 0.0, -2.3783339999999997), (-0.74631599999999998, 0.0, -2.9816039999999999), (0.84000000000000008, 0.0, -2.7000000000000002)], [0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 41.0, 41.0]], 'Cur14': [3, [(0.30000000000000004, 1.9984014443252821e-016, 0.90000000000000013), (0.30000000000000004, 4.6629367034256577e-016, 2.1000000000000001), (0.30000000000000004, 4.6629367034256577e-016, 2.1000000000000001), (0.30000000000000004, 4.6629367034256577e-016, 2.1000000000000001), (0.90000000000000013, 4.6629367034256577e-016, 2.1000000000000001), (0.90000000000000013, 4.6629367034256577e-016, 2.1000000000000001), (0.90000000000000013, 4.6629367034256577e-016, 2.1000000000000001), (0.0, 6.6613381477509392e-016, 3.0), (0.0, 6.6613381477509392e-016, 3.0), (0.0, 6.6613381477509392e-016, 3.0), (-0.90000000000000013, 4.6629367034256577e-016, 2.1000000000000001), (-0.90000000000000013, 4.6629367034256577e-016, 2.1000000000000001), (-0.90000000000000013, 4.6629367034256577e-016, 2.1000000000000001), (-0.30000000000000004, 4.6629367034256577e-016, 2.1000000000000001), (-0.30000000000000004, 4.6629367034256577e-016, 2.1000000000000001), (-0.30000000000000004, 4.6629367034256577e-016, 2.1000000000000001), (-0.30000000000000004, 1.9984014443252821e-016, 0.90000000000000013), (-0.30000000000000004, 1.9984014443252821e-016, 0.90000000000000013), (-0.30000000000000004, 1.9984014443252821e-016, 0.90000000000000013), (-0.71999999999999997, 1.5987211554602254e-016, 0.71999999999999997), (-0.90000000000000013, 6.6613381477509402e-017, 0.30000000000000004), (-0.90000000000000013, 6.6613381477509402e-017, 0.30000000000000004), (-0.90000000000000013, 6.6613381477509402e-017, 0.30000000000000004), (-2.1000000000000001, 6.6613381477509402e-017, 0.30000000000000004), (-2.1000000000000001, 6.6613381477509402e-017, 0.30000000000000004), (-2.1000000000000001, 6.6613381477509402e-017, 0.30000000000000004), (-2.1000000000000001, 1.9984014443252821e-016, 0.90000000000000013), (-2.1000000000000001, 1.9984014443252821e-016, 0.90000000000000013), (-2.1000000000000001, 1.9984014443252821e-016, 0.90000000000000013), (-3.0, 0.0, 0.0), (-3.0, 0.0, 0.0), (-3.0, 0.0, 0.0), (-2.1000000000000001, -1.9984014443252821e-016, -0.90000000000000013), (-2.1000000000000001, -1.9984014443252821e-016, -0.90000000000000013), (-2.1000000000000001, -1.9984014443252821e-016, -0.90000000000000013), (-2.1000000000000001, -6.6613381477509402e-017, -0.30000000000000004), (-2.1000000000000001, -6.6613381477509402e-017, -0.30000000000000004), (-2.1000000000000001, -6.6613381477509402e-017, -0.30000000000000004), (-0.90000000000000013, -6.6613381477509402e-017, -0.30000000000000004), (-0.90000000000000013, -6.6613381477509402e-017, -0.30000000000000004), (-0.90000000000000013, -6.6613381477509402e-017, -0.30000000000000004), (-0.71999999999999997, -1.5987211554602254e-016, -0.71999999999999997), (-0.30000000000000004, -1.9984014443252821e-016, -0.90000000000000013), (-0.30000000000000004, -1.9984014443252821e-016, -0.90000000000000013), (-0.30000000000000004, -1.9984014443252821e-016, -0.90000000000000013), (-0.30000000000000004, -4.6629367034256577e-016, -2.1000000000000001), (-0.30000000000000004, -4.6629367034256577e-016, -2.1000000000000001), (-0.30000000000000004, -4.6629367034256577e-016, -2.1000000000000001), (-0.90000000000000013, -4.6629367034256577e-016, -2.1000000000000001), (-0.90000000000000013, -4.6629367034256577e-016, -2.1000000000000001), (-0.90000000000000013, -4.6629367034256577e-016, -2.1000000000000001), (0.0, -6.6613381477509392e-016, -3.0), (0.0, -6.6613381477509392e-016, -3.0), (0.0, -6.6613381477509392e-016, -3.0), (0.90000000000000013, -4.6629367034256577e-016, -2.1000000000000001), (0.90000000000000013, -4.6629367034256577e-016, -2.1000000000000001), (0.90000000000000013, -4.6629367034256577e-016, -2.1000000000000001), (0.30000000000000004, -4.6629367034256577e-016, -2.1000000000000001), (0.30000000000000004, -4.6629367034256577e-016, -2.1000000000000001), (0.30000000000000004, -4.6629367034256577e-016, -2.1000000000000001), (0.30000000000000004, -1.9984014443252821e-016, -0.90000000000000013), (0.30000000000000004, -1.9984014443252821e-016, -0.90000000000000013), (0.30000000000000004, -1.9984014443252821e-016, -0.90000000000000013), (0.71999999999999997, -1.5987211554602254e-016, -0.71999999999999997), (0.90000000000000013, -6.6613381477509402e-017, -0.30000000000000004), (0.90000000000000013, -6.6613381477509402e-017, -0.30000000000000004), (0.90000000000000013, -6.6613381477509402e-017, -0.30000000000000004), (2.1000000000000001, -6.6613381477509402e-017, -0.30000000000000004), (2.1000000000000001, -6.6613381477509402e-017, -0.30000000000000004), (2.1000000000000001, -6.6613381477509402e-017, -0.30000000000000004), (2.1000000000000001, -1.9984014443252821e-016, -0.90000000000000013), (2.1000000000000001, -1.9984014443252821e-016, -0.90000000000000013), (2.1000000000000001, -1.9984014443252821e-016, -0.90000000000000013), (3.0, 0.0, 0.0), (3.0, 0.0, 0.0), (3.0, 0.0, 0.0), (2.1000000000000001, 1.9984014443252821e-016, 0.90000000000000013), (2.1000000000000001, 1.9984014443252821e-016, 0.90000000000000013), (2.1000000000000001, 1.9984014443252821e-016, 0.90000000000000013), (2.1000000000000001, 6.6613381477509402e-017, 0.30000000000000004), (2.1000000000000001, 6.6613381477509402e-017, 0.30000000000000004), (2.1000000000000001, 6.6613381477509402e-017, 0.30000000000000004), (0.90000000000000013, 6.6613381477509402e-017, 0.30000000000000004), (0.90000000000000013, 6.6613381477509402e-017, 0.30000000000000004), (0.71999999999999997, 1.5987211554602254e-016, 0.71999999999999997), (0.30000000000000004, 1.9984014443252821e-016, 0.90000000000000013), (0.30000000000000004, 1.9984014443252821e-016, 0.90000000000000013), (0.30000000000000004, 1.9984014443252821e-016, 0.90000000000000013)], [0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0, 64.0, 65.0, 66.0, 67.0, 68.0, 69.0, 70.0, 71.0, 72.0, 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0, 81.0, 82.0, 83.0, 84.0, 85.0, 85.0, 85.0]], 'Cur15': [1, [(-3.0, 3.0, 0.0), (3.0, 0.0, 0.0), (-3.0, -3.0, 0.0), (-3.0, 3.0, 0.0)]], 'Cur10': [3, [(0.0, 0.33000000000000002, -2.9700000000000002), (-0.66000000000000014, 0.33000000000000002, -2.9700000000000002), (-2.26775868, 0.33000000000000002, -2.4714115800000003), (-3.3000000000000003, 0.33000000000000002, 0.0), (-2.3334531000000003, 0.33000000000000002, 2.3334531000000003), (0.0, 0.33000000000000002, 3.3000000000000003), (2.3334531000000003, 0.33000000000000002, 2.3334531000000003), (3.3000000000000003, 0.33000000000000002, 0.0), (2.3594999999999997, 0.33000000000000002, -2.1450000000000005), (1.136240028, 0.33000000000000002, -2.7549733199999999), (1.136240028, 0.33000000000000002, -2.7549733199999999), (1.136240028, 0.33000000000000002, -2.7549733199999999), (1.136240028, 0.66000000000000003, -2.7549733199999999), (1.136240028, 0.66000000000000003, -2.7549733199999999), (1.136240028, 0.66000000000000003, -2.7549733199999999), (0.0, 0.0, -2.9700000000000002), (0.0, 0.0, -2.9700000000000002), (0.0, 0.0, -2.9700000000000002), (1.136240028, -0.66000000000000003, -2.7549733199999999), (1.136240028, -0.66000000000000003, -2.7549733199999999), (1.136240028, -0.66000000000000003, -2.7549733199999999), (1.136240028, -0.33000000000000002, -2.7549733199999999), (1.136240028, -0.33000000000000002, -2.7549733199999999), (1.136240028, -0.33000000000000002, -2.7549733199999999), (2.3584664070000003, -0.33000000000000002, -2.1521065500000005), (3.3000000000000003, -0.33000000000000002, 0.0), (2.3334531000000003, -0.33000000000000002, 2.3334531000000003), (0.0, -0.33000000000000002, 3.3000000000000003), (-2.3334531000000003, -0.33000000000000002, 2.3334531000000003), (-3.3000000000000003, -0.33000000000000002, 0.0), (-2.3137447410000003, -0.33000000000000002, -2.2940362500000004), (-0.66000000000000014, -0.33000000000000002, -2.9700000000000002), (0.0, -0.33000000000000002, -2.9700000000000002), (0.0, -0.33000000000000002, -2.9700000000000002), (0.0, -0.33000000000000002, -2.9700000000000002), (0.0, 0.33000000000000002, -2.9700000000000002)], [0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 33.0, 33.0]], 'Cur11': [3, [(0.90000000000000013, 0.0, -0.30000000000000004), (0.90000000000000013, 0.0, -0.30000000000000004), (0.90000000000000013, 0.0, -0.30000000000000004), (2.1000000000000001, 0.0, -0.30000000000000004), (2.1000000000000001, 0.0, -0.30000000000000004), (2.1000000000000001, 0.0, -0.30000000000000004), (2.1000000000000001, 0.0, -0.90000000000000013), (2.1000000000000001, 0.0, -0.90000000000000013), (2.1000000000000001, 0.0, -0.90000000000000013), (3.0, 0.0, 0.0), (3.0, 0.0, 0.0), (3.0, 0.0, 0.0), (2.1000000000000001, 0.0, 0.90000000000000013), (2.1000000000000001, 0.0, 0.90000000000000013), (2.1000000000000001, 0.0, 0.90000000000000013), (2.1000000000000001, 0.0, 0.30000000000000004), (2.1000000000000001, 0.0, 0.30000000000000004), (2.1000000000000001, 0.0, 0.30000000000000004), (0.90000000000000013, 0.0, 0.30000000000000004), (0.90000000000000013, 0.0, 0.30000000000000004), (0.90000000000000013, 0.0, 0.30000000000000004), (0.67500000000000004, 0.0, 0.76500000000000001), (0.0, 0.0, 1.0350000000000001), (-0.67500000000000004, 0.0, 0.76500000000000001), (-0.90000000000000013, 0.0, 0.30000000000000004), (-0.90000000000000013, 0.0, 0.30000000000000004), (-0.90000000000000013, 0.0, 0.30000000000000004), (-2.1000000000000001, 0.0, 0.30000000000000004), (-2.1000000000000001, 0.0, 0.30000000000000004), (-2.1000000000000001, 0.0, 0.30000000000000004), (-2.1000000000000001, 0.0, 0.90000000000000013), (-2.1000000000000001, 0.0, 0.90000000000000013), (-2.1000000000000001, 0.0, 0.90000000000000013), (-3.0, 0.0, 0.0), (-3.0, 0.0, 0.0), (-3.0, 0.0, 0.0), (-2.1000000000000001, 0.0, -0.90000000000000013), (-2.1000000000000001, 0.0, -0.90000000000000013), (-2.1000000000000001, 0.0, -0.90000000000000013), (-2.1000000000000001, 0.0, -0.30000000000000004), (-2.1000000000000001, 0.0, -0.30000000000000004), (-2.1000000000000001, 0.0, -0.30000000000000004), (-0.90000000000000013, 0.0, -0.30000000000000004), (-0.90000000000000013, 0.0, -0.30000000000000004), (-0.90000000000000013, 0.0, -0.30000000000000004), (-0.67500000000000004, 0.0, -0.76500000000000001), (0.0, 0.0, -1.0350000000000001), (0.67500000000000004, 0.0, -0.76500000000000001), (0.90000000000000013, 0.0, -0.30000000000000004), (0.90000000000000013, 0.0, -0.30000000000000004), (0.90000000000000013, 0.0, -0.30000000000000004)], [0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 48.0, 48.0]], 'Cur12': [1, [(0.0, -1.5, 1.5), (0.0, -1.5, 3.0), (0.0, 1.5, 3.0), (0.0, 1.5, 1.5), (0.0, 3.0, 1.5), (0.0, 3.0, -1.5), (0.0, 1.5, -1.5), (0.0, 1.5, -3.0), (0.0, -1.5, -3.0), (0.0, -1.5, -1.5), (0.0, -3.0, -1.5), (0.0, -3.0, 1.5), (0.0, -1.5, 1.5)]], 'Cur13': [1, [(0.0, 0.0, 0.0), (0.0, 3.0, 0.0), (-1.5, 3.0, 0.0), (0.0, 5.25, 0.0), (1.5, 3.0, 0.0), (0.0, 3.0, 0.0)]]}
if window('YJ_Colour',q=1,ex=1):
deleteUI('YJ_Colour',window=1)
window('YJ_Colour',w=480,h=480)
columnLayout('YJ_Colour_all',adj=1)
gridLayout( numberOfColumns=7, cellWidthHeight=(25, 25) ,p='YJ_Colour_all')
Colour_List=[]
for i in range(1,32):
Colour_List_Child=colorIndex(i, q=True )
Colour_List.append(Colour_List_Child)
YJ_Cavas_Nub=0
for j in range(1,32):
YJ_rgb=Colour_List[YJ_Cavas_Nub]
YJ_canvas_name='canvas'+str(YJ_Cavas_Nub)
canvas(YJ_canvas_name,rgbValue=YJ_rgb,pc='YJ_set_color(%d)'%j)
YJ_Cavas_Nub=YJ_Cavas_Nub+1
separator(height=10, style='double' ,p='YJ_Colour_all')
gridLayout( numberOfColumns=4, cellWidthHeight=(45, 45),p='YJ_Colour_all' )
YJ_Curve_Base='Cur'
os.chdir(PicPath)
ImageDir = glob.glob('*.bmp')
ImageNub= len(ImageDir)
for i in range(0,ImageNub):
YJ_Curve_Button_Name=YJ_Curve_Base+str(i)+'.bmp'
YJ_Curve_Button_Path=PicPath+YJ_Curve_Button_Name
KeyName=YJ_Curve_Base+str(i)
symbolButton(image=YJ_Curve_Button_Path,c='YJ_Creat_Ctrl("%s","%s")'%(KeyName,KeyName))
columnLayout('AddButton',adj=1,p='YJ_Colour_all')
button('SaveCurve',c='AddClassToCurve()')
button('SnapShot&Save',c='YJ_CurNameAndSaveImg()')
button('ReSnapShot&Save',c='YJ_ReCurNameAndSaveImg()')
button('ZeroGrp',c='YJRigZeroGrp("select")')
button('Shape>>To>>Jnt',c='YJ_Parent_Shape("None","None",1,0)')
CurClassPath=ClassTxt
CurClassOpen=open(CurClassPath,'r')
CurClassRead=CurClassOpen.read()
data = open(ClassTxt).read()
dataJudge=len(data)
if dataJudge == 0:
CurClass=BaseClass
CurClassOpen=open(CurClassPath,'w')
CurClassOpen.write(str(CurClass))
CurClassOpen.close
else:
exec ("CurClass=" +CurClassRead)
CurClassOpen.close
showWindow()
def YJ_set_color(CoNub):
YJ_Slected_List=ls(sl=1)
YJ_First_Obj_shapeName= listRelatives(YJ_Slected_List,s=1)
for k in YJ_First_Obj_shapeName:
setAttr("%s.overrideEnabled"%k,1)
setAttr('%s.overrideColor'%k,CoNub)
def YJ_CurNameAndSaveImg():
os.chdir(PicPath)
ImageDir = glob.glob('*.bmp')
ImageNub= len(ImageDir)
ImageName='Cur'+str(ImageNub)+'.bmp'
setAttr('defaultRenderGlobals.imageFormat',20)
ImagePath=PicPath+ImageName
playblast(v=0,frame=1,w=90,h=90,orn=0,cf=ImagePath,fmt='image')
YJ_Ctrl_Colour()
def AddClassToCurve():
######GetCurrentCurveClass
ClassTxt='C:\\Users\\yangjie\\Documents\\maya\\2014-x64\\prefs\\icons\\CurIcon\\CurveClass.txt'
CurClassPath=ClassTxt
CurClassOpen=open(CurClassPath,'r')
CurClassRead=CurClassOpen.read()
data = open(ClassTxt).read()
dataJudge=len(data)
if dataJudge == 0:
CurClass=BaseClass
else:
exec ("CurClass=" +CurClassRead)
CurClassOpen.close
###get Degree
CurSelList=ls(sl=1)
CurSel=CurSelList[-1]
##Get The Key Name
KeyList=list(CurClass.keys())
KeyNub=len(KeyList)
KeyName='Cur'+str(KeyNub)
#The Degree To Class
getDegree = getAttr(CurSel+'.d')
CurClass[KeyName]=[getDegree ]
#ThePointPivList
CurvePoint=getAttr( '%s.cv[*]'%CurSel)
CurClass[KeyName].append(CurvePoint)
if getDegree > 1:
###get Knots
len(CurvePoint)
getSpan = getAttr(CurSel+'.spans')
createNode('curveInfo',n='CurveIInfKnot' )
CurveShapeName= listRelatives(CurSel,s=1)
CurveShapeNameStr=CurveShapeName[-1]
connectAttr( '%s.worldSpace'%CurveShapeNameStr, 'CurveIInfKnot.inputCurve' )
CurveKnot=getAttr( 'CurveIInfKnot.knots[*]' )
delete ('CurveIInfKnot')
CurClass[KeyName].append(CurveKnot)
###Write Class To Txt
CurClassOpen=open(CurClassPath,'w')
CurClassOpen.write(str(CurClass))
CurClassOpen.close
def YJ_Creat_Ctrl(KeyName,YJ_Ctrl_Name):
CurClassPath=ClassTxt
CurClassOpen=open(CurClassPath,'r')
CurClassRead=CurClassOpen.read()
exec ("CurClass=" +CurClassRead)
CurClassOpen.close
InClassList=CurClass[KeyName]
KeyListNub=len(InClassList)
CurDegree=CurClass[KeyName][0]
CurPiv=CurClass[KeyName][1]
if KeyListNub==2:
curve(n=YJ_Ctrl_Name,d=CurDegree,p=CurPiv)
elif KeyListNub==3:
curve(n=YJ_Ctrl_Name,d=CurDegree,p=CurPiv,k=CurClass[KeyName][2])
def YJ_ReCurNameAndSaveImg():
os.chdir(PicPath)
ImageDir = glob.glob('*.bmp')
ImageNub= len(ImageDir)-1
ImageName='Cur'+str(ImageNub)+'.bmp'
setAttr('defaultRenderGlobals.imageFormat',20)
ImagePath=PicPath+ImageName
playblast(v=0,frame=1,w=90,h=90,orn=0,cf=ImagePath,fmt='image')
YJ_Ctrl_Colour()