회원 로그인
|
Shapes Color Changer
Shapes Color Changer
# coding: euc-kr # Shapes Color Changer v0.1 # artsone@dvframes.com # release v0.1 : 2009.04.09 # v0.2 : 2009.04.22 # # 실행 : shapesColor_tool = shapesColorUI() # 함수로 실행시 # 사용법 : shapesColor(사용여부, 컬러번호) # 사용여부 0, 1 # 컬러번호 0~31 import maya.cmds as cmds import maya.mel as mel class shapesColorUI(): def __init__(self): if (cmds.window('shapesColorWin', ex=1)): cmds.deleteUI('shapesColorWin', wnd=1) self.shapescolorwin = cmds.window('shapesColorWin', t=u'Shapes Color Changer v0.1', iconName='ShColorCh', mxb=0) cmds.frameLayout(lv=0, bs="etchedOut") cmds.columnLayout(adj=1) cmds.rowColumnLayout(nc=4, cw=[(1, 30), (2, 30), (3, 30), (4, 30)]) cmds.button(l='X', c='shapesColor(0,0)') #none cmds.button(bgc=[1, 0, 0], l=' ', c='shapesColor(1, 13)') #red cmds.button(bgc=[0.4, 0, 0], l=' ', c='shapesColor(1, 4)') #dark red cmds.button(bgc=[0, 1, 0], l=' ', c='shapesColor(1, 14)') #green cmds.button(bgc=[0, 0.4, 0], l=' ', c='shapesColor(1, 23)') #dark green cmds.button(bgc=[0, 0, 1], l=' ', c='shapesColor(1, 6)') #blue cmds.button(bgc=[0, 0, 0.4], l=' ', c='shapesColor(1, 15)') #dark blue cmds.button(bgc=[1, 1, 0], l=' ', c='shapesColor(1, 17)') #yellow cmds.window('shapesColorWin', e=1, wh=(132, 70)) cmds.showWindow(self.shapescolorwin) mel.eval('print("[Shapes Color Changer] OK!!n")') def shapesColor(enable, colorNo): selObj_ = [] selObj_ = cmds.ls(sl=1) if len(selObj_) >= 1: for sel_ in selObj_: if cmds.objectType(sel_) == 'transform': selShape_ = cmds.listRelatives(sel_, s=1) cmds.setAttr('%s.overrideEnabled' % selShape_, enable) cmds.setAttr('%s.overrideColor' % selShape_, colorNo) if cmds.objectType(sel_) == 'joint': cmds.setAttr('%s.overrideEnabled' % sel_, enable) cmds.setAttr('%s.overrideColor' % sel_, colorNo) else: mel.eval('warning("[SCC] Must select Objejct.n")') shapesColorChanger_tool = shapesColorUI()
댓글 0개
| 엮인글 0개
466개(1/24페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
마야 뷰포트 네비게이션 팁 | 푸딩뱃살 | 43899 | 2020.04.06 17:22 | |
Maya 버전 별 Python 버전 | 푸딩뱃살 | 65075 | 2014.01.08 17:59 | |
464 | [Dev] Autodesk Maya Devkit 다운로드 | 푸딩뱃살 | 706 | 2023.01.28 14:28 |
463 | [Base] (해결 중) modules 환경설정 중 | 푸딩뱃살 | 655 | 2022.11.09 11:47 |
462 | [Script] pymel 딕셔너리형 사용 시 KeyError | 푸딩뱃살 | 865 | 2022.11.07 12:08 |
461 | [오류] Building Numpy for Maya Python 2.7.x | 푸딩뱃살 | 601 | 2022.10.23 14:38 |
460 | [Base] 뷰포트에서 조절자가 안 보일때 | 푸딩뱃살 | 789 | 2022.10.13 15:47 |
459 | [Rigging] mirror joints 사용 시 유의 사항 | 푸딩뱃살 | 803 | 2022.10.04 10:46 |
458 | [Script] 2022에서 enum34 모듈 설치 금지 | 푸딩뱃살 | 611 | 2022.08.17 18:08 |
457 | [Script] pymel 예제 | 푸딩뱃살 | 625 | 2022.07.05 19:20 |
456 | [Script] 인코드 / 디코드 - 2.7 한글 사용 | 푸딩뱃살 | 901 | 2022.03.08 17:52 |
455 | [Dev] ui 없이 mayapy로 자동화 | 푸딩뱃살 | 705 | 2022.02.17 13:56 |
454 | [Dev] mayapy로 ui파일 py로 | 푸딩뱃살 | 531 | 2022.02.15 18:20 |
453 | [오류] Error : MayaBonusTools | 푸딩뱃살 | 923 | 2022.01.21 17:52 |
452 | [오류] Error: ModuleNotFoundError | 푸딩뱃살 | 777 | 2022.01.21 16:24 |
451 | [Dev] mayapy | 푸딩뱃살 | 656 | 2022.01.19 20:08 |
450 | [Base] function selCom at 0x7f29c5c04aa0 | 푸딩뱃살 | 617 | 2022.01.19 17:24 |
449 | [Base] wireframe on shaded 단축키 만들기 | 푸딩뱃살 | 916 | 2022.01.04 10:55 |
448 | [오류] OpenCL Error | 푸딩뱃살 | 526 | 2021.12.28 01:40 |
447 | [Script] Easily Translate MEL Commands to Python | 푸딩뱃살 | 834 | 2021.12.02 11:22 |
446 | [Base] output window 띄우지 않기 | 푸딩뱃살 | 827 | 2021.11.24 21:44 |
445 | [Rigging] shapeEditorManager 삭제 안됨 | 푸딩뱃살 | 897 | 2021.11.12 23:30 |