aboutsummaryrefslogtreecommitdiff
path: root/Core/Scripts/Interfaces/ART_RigHistoryUI.py
diff options
context:
space:
mode:
authorMobileMachine\jeremy <[email protected]>2017-06-06 22:59:03 -0400
committerMobileMachine\jeremy <[email protected]>2017-06-06 22:59:03 -0400
commit24725fa8681f906ab44d80687c09fecc171a2896 (patch)
tree312a601df29aca7f8db9f44082d96ebc7a679138 /Core/Scripts/Interfaces/ART_RigHistoryUI.py
parentInitial commit (diff)
downloadartv2-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_RigHistoryUI.py')
-rw-r--r--Core/Scripts/Interfaces/ART_RigHistoryUI.py136
1 files changed, 136 insertions, 0 deletions
diff --git a/Core/Scripts/Interfaces/ART_RigHistoryUI.py b/Core/Scripts/Interfaces/ART_RigHistoryUI.py
new file mode 100644
index 0000000..20540e6
--- /dev/null
+++ b/Core/Scripts/Interfaces/ART_RigHistoryUI.py
@@ -0,0 +1,136 @@
+'''
+Created on Aug 26, 2015
+
+@author: jeremy.ernst
+'''
+
+from ThirdParty.Qt import QtGui, QtCore, QtWidgets
+import maya.cmds as cmds
+import os, json
+import System.utils as utils
+
+
+
+
+class ART_RigHistoryUI():
+ #Original Author: Jeremy Ernst
+
+ def __init__(self, mainUI):
+
+ #get the directory path of the tools
+ settings = QtCore.QSettings("Epic Games", "ARTv2")
+ self.toolsPath = settings.value("toolsPath")
+ self.iconsPath = settings.value("iconPath")
+ self.scriptPath = settings.value("scriptPath")
+ self.projectPath = settings.value("projectPath")
+
+
+ self.mainUI = mainUI
+ self.rigData = []
+ self.warnings = 0
+ self.errors = 0
+
+ #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_RigHistWin", exists = True):
+ cmds.deleteUI("ART_RigHistWin", wnd = True)
+
+ self.buildUI()
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+ def buildUI(self):
+ #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);")
+
+ styleSheetFile = utils.returnNicePath(self.toolsPath, "Core/Scripts/Interfaces/StyleSheets/mainScheme.qss")
+ f = open(styleSheetFile, "r")
+ self.style = f.read()
+ f.close()
+
+ self.mainWin.setStyleSheet(self.style)
+
+
+ #create the main widget
+ self.mainWidget = QtWidgets.QWidget()
+ self.mainWin.setCentralWidget(self.mainWidget)
+
+ #set qt object name
+ self.mainWin.setObjectName("ART_RigHistWin")
+ self.mainWin.setWindowTitle("Rig History")
+
+ #font
+ headerFont = QtGui.QFont()
+ headerFont.setPointSize(8)
+ headerFont.setBold(True)
+
+ #set size policy
+ mainSizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
+
+ #create the mainLayout for the rig creator UI
+ self.layout = QtWidgets.QVBoxLayout(self.mainWidget)
+
+
+ self.mainWin.resize(400, 240)
+ self.mainWin.setSizePolicy(mainSizePolicy)
+ self.mainWin.setMinimumSize(QtCore.QSize( 400, 240 ))
+ self.mainWin.setMaximumSize(QtCore.QSize( 400, 240 ))
+
+ #create the QFrame for this page
+ self.background = QtWidgets.QFrame()
+ self.layout.addWidget(self.background)
+ self.mainLayout = QtWidgets.QVBoxLayout(self.background)
+ self.background.setObjectName("epic")
+
+
+ #detailed information
+ self.infoText = QtWidgets.QTextEdit()
+ self.mainLayout.addWidget(self.infoText)
+ self.infoText.setMinimumSize(QtCore.QSize( 360, 200 ))
+ self.infoText.setMaximumSize(QtCore.QSize( 360, 200 ))
+ self.infoText.setReadOnly(True)
+ self.infoText.setWordWrapMode(QtGui.QTextOption.WordWrap)
+
+ #show the window
+ self.mainWin.show()
+
+ self.getHistory()
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+ def getHistory(self):
+
+
+ characterNode = "ART_RIG_ROOT"
+ data = json.loads(cmds.getAttr(characterNode + ".versionNote"))
+
+ for each in data:
+
+ version = each[0]
+ info = each[1]
+ user = each[2]
+
+ self.infoText.setTextColor(QtGui.QColor(236,217,0))
+ self.infoText.append("Version #: " + str(version))
+ self.infoText.setTextColor(QtGui.QColor(255,255,255))
+ self.infoText.append("Description: " + info)
+ self.infoText.setTextColor(QtGui.QColor(0,255,0))
+ self.infoText.append("User: " + user + "\n\n")
+
+