회원 로그인
|
QT 예제 with Maya
# -*- coding: utf-8 -*- import maya.OpenMayaUI as mui import sip, sys from PyQt4 import QtGui, QtCore, uic import maya.cmds as cmds import maya.mel as mel def getMayaWindow(): ptr = mui.MQtUtil.mainWindow() return sip.wrapinstance(long(ptr), QtCore.QObject) usrProfile = mel.eval('getenv("USERPROFILE")') mayaVersion = "2013-x64" uiFile = (usrProfile+'/Documents/maya/'+mayaVersion+'/scripts/installer.ui') form_class, base_class = uic.loadUiType(uiFile) class myUIClass(form_class, base_class): def __init__(self, parent=getMayaWindow()): super(myUIClass, self).__init__(parent) self.setupUi(self) self.connectSignals() def connectSignals(self): #self.connect(self.ui명, QtCore.SIGNAL('released()'), self.함수명) self.agree_checkBox.clicked.connect(self.checkBox) self.connect(self.quit_btn, QtCore.SIGNAL('clicked()'), self.close) self.agree_btn.clicked.connect(self.agree) print "Connect signals" def checkBox(self): if self.agree_checkBox.isChecked(): self.agree_btn.setEnabled(True) else: self.agree_btn.setEnabled(False) def agree(self): print 'agree' def runUI(): global app global win app = QtGui.qApp win = myUIClass() win.show() #app.connect(app, QtCore.SIGNAL('lastWindowClosed()'), app, QtCore.SLOT('quit()')) #마야를 종료해 버림 #sys.exit() #self.quit_btn.clicked.connect(QtCore.QCoreApplication.instance().quit) #윈도우 타이틀을 바꿈 #self.setWindowTitle(u'테스트') #이렇게 사용할 수도 있음 #self.agree_checkBox.clicked.connect(self.checkBox) #self.connect(self.agree_checkBox, QtCore.SIGNAL('clicked()'), self.checkBox) #이렇게 사용할 수도 있음 #self.agree_btn.clicked.connect(self.agree) #self.connect(self.agree_btn, QtCore.SIGNAL('released()'), self.agree) #실행 import installer as ki reload(ki) ki.runUI()
체크박스와 버튼 사용 예제
- installer.py (2KB) (0)
- installer.ui (3.9KB) (0)
댓글 0개
| 엮인글 0개
466개(11/24페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
마야 뷰포트 네비게이션 팁 | 푸딩뱃살 | 42983 | 2020.04.06 17:22 | |
Maya 버전 별 Python 버전 | 푸딩뱃살 | 64296 | 2014.01.08 17:59 | |
264 | [Rigging] Joint Tool | 푸딩뱃살 | 2755 | 2015.03.23 10:19 |
263 | [Script] 저장 시 scriptNode 생성 | 푸딩뱃살 | 4373 | 2015.03.16 17:08 |
262 | [Script] setAttr를 이용한 channelbox, outliner 제어 | 푸딩뱃살 | 4609 | 2015.03.16 03:43 |
261 | [Script] angleBetween() | 푸딩뱃살 | 4752 | 2015.03.10 14:28 |
260 | [Plugin] OutlinerPlus v1.3 | 푸딩뱃살 | 4696 | 2015.03.04 02:25 |
259 | [오류] Python 설치 시 Maya 문제 | 푸딩뱃살 | 4622 | 2015.02.25 17:04 |
258 | [Script] progressBar() | 푸딩뱃살 | 5007 | 2015.02.23 18:26 |
257 | [Script] Polygon(Mesh) 선택 Script | 푸딩뱃살 | 4836 | 2015.02.13 14:00 |
256 | [Rigging] rigTip - maya collision system with matrix | 푸딩뱃살 | 2243 | 2014.12.03 17:30 |
255 | [Rigging] rigTip - line plane intersection with maya nodes | 푸딩뱃살 | 2457 | 2014.12.03 17:28 |
254 | [Rigging] rigTip - How Move a Skinned Joint | 푸딩뱃살 | 2593 | 2014.12.03 17:23 |
253 | [Rigging] translateX 스트레치 노드 | 푸딩뱃살 | 3927 | 2014.09.30 18:19 |
252 | [Modeling] Polygon Primitives 생성/편집 | 푸딩뱃살 | 3809 | 2014.09.21 10:32 |
251 | [Base] Node Editor 기본 사용법 | 푸딩뱃살 | 5485 | 2014.09.21 10:18 |
250 | [Rigging] Copy Skin Weights | 푸딩뱃살 | 3092 | 2014.08.04 14:06 |
>> | [Script] QT 예제 with Maya | 푸딩뱃살 | 4086 | 2014.05.20 18:36 |
248 | [Script] QT 예제 - 노드 리네임 | 푸딩뱃살 | 3334 | 2014.05.20 18:26 |
247 | [Script] 마야에서 QT 사용 | 푸딩뱃살 | 2097 | 2014.05.20 18:18 |
246 | [Base] 마야 파일 더블클릭으로 원하는 마야 버젼 실행하기 | 푸딩뱃살 | 5008 | 2014.04.03 13:29 |
245 | [Script] QT 설치 for Maya 2011 | 푸딩뱃살 | 5356 | 2014.03.13 11:34 |