vfxwindow
ved PyMEL
여러 VFX 프로그램간에 호환되는 도구를 설계하기위한 QT 창 클래스.
클래스의 주요 목적은 프로그램 UI에 통합하는 것이지만 콜백을 안전하게 처리하고 자동으로 창 위치를 저장하는 것과 같은 유용한 기능도 포함되어 있습니다.
의도 된 사용법은 QMainWindow 의 인스턴스 인 Window Class가 VFXWindow 상속하는 것입니다. cls.show() 호출하면로드 된 프로그램과 이전에 저장된 설정에 따라 올바른 창 유형을 시작합니다.
이것은 완벽하게 안정적이지만 개선이 필요한 많은 것이 있습니다. 기존 애플리케이션 지원을 확장하거나 새로운 응용 프로그램 추가에 대한 모든 도움은 대단히 감사합니다.
pip install vfxwindow
from Qt import QtWidgets
from vfxwindow import VFXWindow
class MyWindow ( VFXWindow ):
"""Test window to show off some features."""
WindowID = 'vfx.window.test'
WindowName = 'My Window'
WindowDockable = True
def __init__ ( self , parent = None , ** kwargs ):
super ( MyWindow , self ). __init__ ( parent , ** kwargs )
# Setup widgets/build UI here as you normally would
self . setCentralWidget ( QtWidgets . QWidget ())
# Setup callbacks
self . callbacks . add ( 'file.new' , self . afterSceneChange )
self . callbacks . add ( 'file.load' , self . afterSceneChange )
if self . application == 'Maya' : # Maya supports before/after callbacks
self . callbacks . add ( 'file.new.before' , self . beforeSceneChange )
self . callbacks . add ( 'file.load.before' , self . beforeSceneChange )
elif self . application in ( 'Nuke' , 'Substance' ): # Nuke and Painter/Designer support close
self . callbacks . add ( 'file.close' , self . beforeSceneChange )
# Wait until the program is ready before triggering the new scene method
self . deferred ( self . afterSceneChange )
def afterSceneChange ( self , * args ):
"""Create the scene specific callbacks.
These are being created in a callback "group".
Subgroups are also supported.
Even though the callback is the same, the signatures can differ.
See '/vfxwindow/<app>/callbacks.py' for the relevant signatures.
"""
if self . application == 'Maya' :
self . callbacks [ 'scene' ]. add ( 'node.add' , self . mayaNodeAdded , nodeType = 'dependNode' )
if self . application == 'Nuke' :
self . callbacks [ 'scene' ]. add ( 'node.add' , self . nukeNodeAdded )
def beforeSceneChange ( self , * args ):
"""Delete the scene specific callbacks."""
self . callbacks [ 'scene' ]. delete ()
def mayaNodeAdded ( self , node , clientData ):
"""Print out the node that was added in Maya."""
import maya . api . OpenMaya as om2
print ( 'Node was added: {}' . format ( om2 . MFnDependencyNode ( node ). name ()))
def nukeNodeAdded ( self ):
"""Print out the node that was added in Nuke."""
import nuke
node = nuke . thisNode ()
print ( 'Node was added: {}' . format ( node . name () or 'Root' ))
def checkForChanges ( self ):
"""Update the UI if it is has been in a "paused" state.
This is needed for Nuke and Substance Designer/Painter, because
there's no way to detect if the window is closed or just hidden.
For safety all callbacks will get paused, and upon unpausing,
this method will be run to allow the window to correctly update.
"""
self . beforeSceneChange ()
self . afterSceneChange ()
if __name__ == '__main__' :
MyWindow . show ()✔️ 작업 / / 테스트되지 않은 / 작동하지 않습니다
| 표준 창 | 도킹 된 창 | 콜백 | 테스트 된 버전 | 리눅스 | 창 | 마코스 | |
|---|---|---|---|---|---|---|---|
| 마야 | ✔️ | ✔️ | ✔️ | 2011-2016, 2017+ | ✔️ | ✔️ | ❔ |
| Maya (독립형) | ✔️ | ✔️ | ❔ | ✔️ | ❔ | ||
| 핵무기 | ✔️ | ✔️ | ✔️ | 9-14 | ❔ | ✔️ | ❔ |
| 핵무기 (터미널) | ✔️ | ✔️ | ❔ | ✔️ | ❔ | ||
| 후디니 | ✔️ | 16-19 | ✔️ | ✔️ | ❔ | ||
| 비현실적인 엔진 | ✔️ | 4.19-4.23, 5.0-5.3 | ✔️ | ❔ | |||
| 블렌더 | ✔️ | ✔️ | 2.8-4.2 | ❔ | ✔️ | ❔ | |
| 블렌더 (배경) | ✔️ | ❔ | 3.1-4.2 | ❔ | ✔️ | ❔ | |
| 카타나 | ✔️ | 7 | ❔ | ✔️ | ❔ | ||
| 3ds Max | ✔️ | 2018-2020 | ❔ | ✔️ | ❔ | ||
| 물질 화가 | ✔️ | ✔️ | ✔️ | 8.3 | ✔️ | ✔️ | ❔ |
| 물질 디자이너 | ✔️ | ✔️ | ✔️ | 2019.3, 7.1, 12.3 | ✔️ | ✔️ | ❔ |
| 협박 융합 | ✔️ | 9 | ❔ | ✔️ | ❔ | ||
| Cryengine 샌드 박스 | ✔️ | 5.7 | ❔ | ✔️ | ❔ | ||
| 독립형 파이썬 | ✔️ | 2.7 (QT4), 3.7-3.9 (QT5) | ❔ | ✔️ | ❔ | ||
| 천연 탄산 소다 | ✔️ | 2.5 | ❔ | ✔️ | ❔ | ||
| 렌더링 | ✔️ | 1.33 | ❔ | ✔️ | ❔ |
* 추가 세부 사항/문제를보기 위해 밑줄이있는 필드 위에 호버링하십시오.
특정 Windows 응용 프로그램에는 Dispatch 기반 COM 인터페이스가있어 Python과 응용 프로그램 간의 링크가 가능합니다. 응용 프로그램에 연결하는 방법에 대한 예제는 Photoshop-Scripting-Python을 참조하십시오.
현재 이러한 응용 프로그램 내부에서 VFXWindow 시작하는 방법은 없습니다.