회원 로그인
|
QT 예제 - 노드 리네임
QT 예제 - 노드 리네임
# -*- coding: utf-8 -*- import maya.OpenMayaUI as mui import sip 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/rename.ui') form_class, base_class = uic.loadUiType(uiFile) class myRenameUI(form_class, base_class): def __init__(self, parent=getMayaWindow()): super(myRenameUI, self).__init__(parent) self.setupUi( self ) #methods self.connectSignals() #명령하기 전 주요 설정 #ui와 명령어를 연결? def connectSignals(self): #초기화 버튼 self.connect(self.clear_btn, QtCore.SIGNAL('released()'), self.clearTextField) #실행 버튼 self.connect(self.rename_btn, QtCore.SIGNAL('released()'), self.renameNode) pass #초기화 def clearTextField(self): self.nodeName_txt.clear() #이름 변경 def renameNode(self): #텍스트필드에서 입력값 추출 #self.nodeName_txt은 텍스트필드명 text값을 가져오는데 QString형이라 srt()로 문자형으로 변경 currentText = str(self.nodeName_txt.text()) selection = cmds.ls(sl=1) if selection is not None: if len(selection) == 1: if currentText != "": cmds.rename(selection[0], currentText) else: print '텍스트 입력' else: print '오브젝트 하나만 선택' else: print '바꿀 오브젝트 선택' #newWindowTitle = str(self.MainWindow.text()) #self.nodeName_txt.changeEvent(WindowTitleChange=currentText) #print newWindowTitle def runUI(): global app global win app=QtGui.qApp win = myRenameUI() win.show() #창 삭제 #win.destroy() ##마야에서 실행 import rename as rn reload(rn) rn.runUI()QT 예제
댓글 0개
| 엮인글 0개
466개(11/24페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
마야 뷰포트 네비게이션 팁 | 푸딩뱃살 | 42972 | 2020.04.06 17:22 | |
Maya 버전 별 Python 버전 | 푸딩뱃살 | 64275 | 2014.01.08 17:59 | |
264 | [Rigging] Joint Tool | 푸딩뱃살 | 2754 | 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() | 푸딩뱃살 | 4751 | 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() | 푸딩뱃살 | 5006 | 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 | 푸딩뱃살 | 2592 | 2014.12.03 17:23 |
253 | [Rigging] translateX 스트레치 노드 | 푸딩뱃살 | 3927 | 2014.09.30 18:19 |
252 | [Modeling] Polygon Primitives 생성/편집 | 푸딩뱃살 | 3808 | 2014.09.21 10:32 |
251 | [Base] Node Editor 기본 사용법 | 푸딩뱃살 | 5483 | 2014.09.21 10:18 |
250 | [Rigging] Copy Skin Weights | 푸딩뱃살 | 3092 | 2014.08.04 14:06 |
249 | [Script] QT 예제 with Maya | 푸딩뱃살 | 4085 | 2014.05.20 18:36 |
>> | [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 |