def __init__(self, selection, selectedPresets, parent=None): super(NimHieroExport.NimBuildTrackDialog, self).__init__(parent) self.pref_elementType = '' self.element = '' self.elementID = None self.nim_elementTypes = [] self.nim_elementTypesDict = {} #Get NIM Element Types self.nim_elementTypes = nimAPI.get_elementTypes() #print self.nim_elementTypes self.setWindowTitle("NIM Build Track from Elements") self.setSizeGripEnabled(True) self._exportTemplate = None layout = QVBoxLayout() formLayout = QFormLayout() # Element Types: List box for element type selection self.nimElementTypeLabel = QLabel() self.nimElementTypeLabel.setText("Element Types:") layout.addWidget(self.nimElementTypeLabel) self.nim_elementTypeChooser = QComboBox() self.nim_elementTypeChooser.setToolTip("Choose the elementType you wish to create a track from.") self.nim_elementTypeChooser.currentIndexChanged.connect(self.nim_elementTypeChanged) layout.addWidget(self.nim_elementTypeChooser) #Add dictionary in ordered list if len(self.nim_elementTypes)>0: for element in self.nim_elementTypes: self.nim_elementTypesDict[element['name']] = element['ID'] for key, value in sorted(self.nim_elementTypesDict.items(), reverse=False): self.nim_elementTypeChooser.addItem(key) if self.pref_elementType != '': self.nim_elementTypeChooser.setCurrentIndex(self.nim_elementTypesDict.keys().index(self.pref_elementType)) # Add the standard ok/cancel buttons, default to ok. self._buttonbox = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel) self._buttonbox.button(QDialogButtonBox.StandardButton.Ok).setText("Build Track") self._buttonbox.button(QDialogButtonBox.StandardButton.Ok).setDefault(True) self._buttonbox.button(QDialogButtonBox.StandardButton.Ok).setToolTip("Builds a new track based on the published NIM elements.") self._buttonbox.accepted.connect(self.acceptTest) self._buttonbox.rejected.connect(self.reject) layout.addWidget(self._buttonbox) self.setLayout(layout)
def __init__(self, preset, itemTypes): IProcessorUI.__init__(self) self._preset = None self._exportTemplate = None self._exportStructureViewer = None self._contentElement = None self._contentScrollArea = None self._contentUI = None self._editMode = IProcessorUI.ReadOnly self._itemTypes = itemTypes self._tags = [] self._project = None self._exportItems = [] self.setPreset(preset) ''' ####################################################### # NIM VARS ''' self.app = nimFile.get_app() self.prefs = nimPrefs.read() try: self.user = self.prefs['NIM_User'] self.pref_job = self.prefs[self.app + '_Job'] self.pref_show = self.prefs[self.app + '_Show'] self.pref_server = self.prefs[self.app + '_ServerPath'] except: #return False pass self.nim_OS = platform.system() self.nim_userID = nimAPI.get_userID(self.user) if not self.nim_userID: nimUI.GUI().update_user() userInfo = nim.NIM().userInfo() self.user = userInfo['name'] self.nim_userID = userInfo['ID'] print "NIM: user=%s" % self.user print "NIM: userID=%s" % self.nim_userID print "NIM: default job=%s" % self.pref_job #Get NIM Jobs self.nim_jobID = None self.nim_jobs = nimAPI.get_jobs(self.nim_userID) if not self.nim_jobs: print "No Jobs Found" self.nim_jobs["None"] = "0" #self.nim_shows = [] self.nim_servers = {} self.nim_shows = {} self.nim_showDict = {} self.nim_showChooser = QtWidgets.QComboBox() self.nim_serverChooser = QtWidgets.QComboBox() self.nim_jobPaths = {} self.nim_showPaths = {} self.nim_showFolder = '' self.nim_serverOSPath = '' #Get NIM Element Types self.pref_elementType = '' self.element = '' self.elementID = None self.nim_elementTypes = [] self.nim_elementTypesDict = {} self.nim_elementTypes = nimAPI.get_elementTypes() #Get NIM Task Types self.pref_taskType = '' self.task = '' self.taskID = None self.nim_taskTypes = [] self.nim_taskTypesDict = {} self.nim_taskFolderDict = {} self.nim_taskTypes = nimAPI.get_tasks(app='NUKE', userType='all') self.nim_publishElementCheckbox = QtWidgets.QCheckBox() self.nim_publishElement = False self.nim_publishCompCheckbox = QtWidgets.QCheckBox() self.nim_publishComp = False self.loadingNimUI = False '''