회원 로그인
|
PySide2 예제
PySide2 예제
:마야 qt를 위한
참고
도움말(일본어)
:마야 qt를 위한
- window 생성
- dock 가능
from maya import OpenMayaUI as omui try: from PySide2 import QtCore, QtGui, QtWidgets, __version__ from shiboken2 import wrapInstance except ImportError: from PySide import QtCore, QtGui, __version__ from shiboken import wrapInstance mayaMainWindowPtr = omui.MQtUtil.mainWindow() #mainWindow 주소 mayaMainWindow = wrapInstance(long(mayaMainWindowPtr), QtWidgets.QWidget) #mainWindow의 QtWidget? 주소 # WORKS: Widget is fine hello = QtWidgets.QLabel("Hello, World", parent=mayaMainWindow) #QLabel 주소 hello.setObjectName('MyLabel') hello.setWindowFlags(QtCore.Qt.Window) # 이 위젯을 부모가 되어도 독립 실행 형 창으로 만든다. hello.show() hello = None # "hello" 위젯은 부모 역할을 하므로 소멸되지 않는다. # BROKEN: Widget is destroyed hello = QtWidgets.QLabel("Hello, World", parent=None) hello.setObjectName('MyLabel') hello.show() hello = None # "hello"위젯은 부모가 아니므로 소멸된다.dock 가능
#Dockable from maya.app.general.mayaMixin import MayaQWidgetDockableMixin try: from PySide2 import QtCore, QtGui, QtWidgets, __version__ from shiboken2 import wrapInstance except ImportError: from PySide import QtCore, QtGui, __version__ from shiboken import wrapInstance class MyDockableButton(MayaQWidgetDockableMixin, QtWidgets.QPushButton): def __init__(self, parent=None): super(MyDockableButton, self).__init__(parent=parent) self.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred ) self.setText('Push Me') # 윈도우에 dock할 수 없는 버튼을 표시 button = MyDockableButton() button.show(dockable=False) # showRepr() can be used to display the current dockable settings. # print('# ' + button.showRepr()) # show(dockable=False, height=23, width=70, y=610, x=197, floating=True) # 윈도우에 dock이 가능한 버튼을 표시 button.show(dockable=True) print('# ' + button.showRepr()) # show(dockable=True, area='none', height=23, width=70, y=610, x=197, floating=True)
참고
도움말(일본어)
댓글 0개
| 엮인글 0개
466개(7/24페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
마야 뷰포트 네비게이션 팁 | 푸딩뱃살 | 43693 | 2020.04.06 17:22 | |
Maya 버전 별 Python 버전 | 푸딩뱃살 | 64926 | 2014.01.08 17:59 | |
344 | [Script] skinCluster, skinPercent 예제 | 푸딩뱃살 | 3219 | 2018.02.21 11:40 |
>> | [Script] PySide2 예제 | 푸딩뱃살 | 4353 | 2018.02.21 11:30 |
342 | [Script] polyListComponentConversion | 푸딩뱃살 | 3475 | 2018.02.20 17:28 |
341 | [Base] Maya Axis & UE4 Axis | 푸딩뱃살 | 2785 | 2018.01.31 15:04 |
340 | [오류] apex 익스포트 시 경고 with Maya2017 | 푸딩뱃살 | 2820 | 2018.01.26 18:49 |
339 | [Plugin] AnimShader library | 푸딩뱃살 | 3708 | 2018.01.23 11:25 |
338 | [Script] PyMel, cmds와 OpenMaya 처리 속도는? | 푸딩뱃살 | 4432 | 2018.01.23 10:51 |
337 | [오류] Warning: Nucleus evaluation skipped, frame change too la | 푸딩뱃살 | 4126 | 2018.01.19 11:50 |
336 | [Plugin] Mesh Reorder / Transfer vertex position Tool - Mesh Pick | 푸딩뱃살 | 3540 | 2018.01.17 16:35 |
335 | [Base] Maya Help 크롬으로 열기 | 푸딩뱃살 | 2943 | 2018.01.15 15:44 |
334 | [Script] filterExpand | 푸딩뱃살 | 3542 | 2018.01.14 03:56 |
333 | [Script] 자주 사용되는 명령어 | 푸딩뱃살 | 3918 | 2018.01.14 03:16 |
332 | [Script] NumPy v1.9.2 (64bit) | 푸딩뱃살 | 3193 | 2018.01.02 16:28 |
331 | [Script] 마야에 numpy + scipy 설치 | 푸딩뱃살 | 2205 | 2018.01.02 15:28 |
330 | [Node] Tweak 노드 | 푸딩뱃살 | 2865 | 2017.12.15 12:18 |
329 | [Rigging] Translate Stretch | 푸딩뱃살 | 2368 | 2017.12.14 15:57 |
328 | [Node] (작성 중) Utility | 푸딩뱃살 | 2817 | 2017.12.07 15:13 |
327 | [Animation] Dope Sheet | 푸딩뱃살 | 2917 | 2017.11.28 12:53 |
326 | [Rendering] Facial Rigging 참고 영상 | 푸딩뱃살 | 3319 | 2017.11.23 02:21 |
325 | [Rigging] Sticky Lips Rigging | 푸딩뱃살 | 3427 | 2017.11.23 01:38 |