diff options
| author | MobileMachine\jeremy <[email protected]> | 2017-06-06 22:59:03 -0400 |
|---|---|---|
| committer | MobileMachine\jeremy <[email protected]> | 2017-06-06 22:59:03 -0400 |
| commit | 24725fa8681f906ab44d80687c09fecc171a2896 (patch) | |
| tree | 312a601df29aca7f8db9f44082d96ebc7a679138 /Core/Scripts/Interfaces/ART_Help.py | |
| parent | Initial commit (diff) | |
| download | artv2-24725fa8681f906ab44d80687c09fecc171a2896.tar.xz artv2-24725fa8681f906ab44d80687c09fecc171a2896.zip | |
Initial Submission
First submission of current state of ARTv2. Currently considered to be in Alpha. There are a couple of animation tools not implemented yet, and one module not implemented yet, as well as incomplete documentation.
Diffstat (limited to 'Core/Scripts/Interfaces/ART_Help.py')
| -rw-r--r-- | Core/Scripts/Interfaces/ART_Help.py | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/Core/Scripts/Interfaces/ART_Help.py b/Core/Scripts/Interfaces/ART_Help.py new file mode 100644 index 0000000..5e4ef84 --- /dev/null +++ b/Core/Scripts/Interfaces/ART_Help.py @@ -0,0 +1,120 @@ +from ThirdParty.Qt import QtGui, QtCore, QtWidgets +from functools import partial +import maya.cmds as cmds +import os +import System.utils as utils + +#Original Author: Jeremy Ernst + + +class ART_HelpMovie(): + def __init__(self, mainUI, moviePath): + #Original Author: Jeremy Ernst + + #get the directory path of the tools + settings = QtCore.QSettings("Epic Games", "ARTv2") + self.toolsPath = settings.value("toolsPath") + self.projectPath = settings.value("projectPath") + self.iconsPath = settings.value("iconPath") + self.mainUI = mainUI + + #images + self.imageBkgrd = utils.returnFriendlyPath(os.path.join(self.iconsPath, "System/toolbar_background.png")) + self.imageBtnBkrd = utils.returnFriendlyPath(os.path.join(self.iconsPath, "System/blue_field_background.png")) + self.frameBackground = utils.returnFriendlyPath(os.path.join(self.iconsPath, "System/field_background.png")) + + #build the UI + if cmds.window("ART_HelpMovieWin", exists = True): + cmds.deleteUI("ART_HelpMovieWin", wnd = True) + + self.buildHelpMovieUI(moviePath) + + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + def buildHelpMovieUI(self, moviePath): + #Original Author: Jeremy Ernst + + #create the main window + self.mainWin = QtWidgets.QMainWindow(self.mainUI) + self.mainWin.setStyleSheet("background-color: rgb(0, 0, 0);, color: rgb(0,0,0);") + self.mainWin.setMinimumSize(660,520) + self.mainWin.setMaximumSize(660,520) + + #create the main widget + self.mainWidget = QtWidgets.QWidget() + self.mainWin.setCentralWidget(self.mainWidget) + + #create the qFrame so we can have a background + self.frame = QtWidgets.QFrame(self.mainWidget) + self.frame.setStyleSheet("background-color: rgb(0,0,0);") + self.frame.setMinimumSize(660,520) + self.frame.setMaximumSize(660,520) + + #set qt object name + self.mainWin.setObjectName("ART_HelpMovieWin") + self.mainWin.setWindowTitle("Help") + + #font + headerFont = QtGui.QFont() + headerFont.setPointSize(10) + headerFont.setBold(True) + + #create the mainLayout for the rig creator UI + self.layout = QtWidgets.QVBoxLayout(self.frame) + + #set up the screen + self.movie_screen = QtWidgets.QLabel() + + # expand and center the label + self.movie_screen.setAlignment(QtCore.Qt.AlignCenter) + self.layout.addWidget(self.movie_screen) + + + #buttons and button layout + self.buttonlayout = QtWidgets.QHBoxLayout() + self.layout.addLayout(self.buttonlayout) + + spacer = QtWidgets.QSpacerItem(60,0) + self.buttonlayout.addSpacerItem(spacer) + + self.playBtn = QtWidgets.QPushButton("Close") + self.buttonlayout.addWidget(self.playBtn) + self.playBtn.clicked.connect(partial(self.close)) + self.playBtn.setStyleSheet("background-image: url(" + self.imageBtnBkrd + ");background-color: rgb(25, 175, 255);") + self.playBtn.setMinimumHeight(40) + self.playBtn.setMaximumHeight(40) + self.playBtn.setFont(headerFont) + + spacer = QtWidgets.QSpacerItem(60,0) + self.buttonlayout.addSpacerItem(spacer) + + + #set movie from file path + self.movie = QtGui.QMovie(moviePath, QtCore.QByteArray()) + self.movie.setCacheMode(QtGui.QMovie.CacheAll) + self.movie.setSpeed(100) + self.movie_screen.setMovie(self.movie) + + self.movie.start() + + + #show + self.mainWin.show() + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + def close(self): + #Original Author: Jeremy Ernst + + if cmds.window("ART_HelpMovieWin", exists = True): + cmds.deleteUI("ART_HelpMovieWin", wnd = True) +
\ No newline at end of file |