def __init__(self, parent=ueMaya.getMayaWindow()): QtGui.QMainWindow.__init__(self, parent) ueCommonSave.setClasses([]) self.itemMenu = QtGui.QListWidget() self.itemMenu.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) exportWidget = QtGui.QGroupBox("Export") exportWidget.setLayout(QtGui.QHBoxLayout()) exportWidget.layout().addWidget(QtGui.QLabel("Item")) exportWidget.layout().addWidget(self.itemMenu) self.saveWidget = ueCommonSave.Save() buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok| QtGui.QDialogButtonBox.Cancel) centralWidget = QtGui.QWidget() centralWidget.setLayout(QtGui.QVBoxLayout()) centralWidget.layout().addWidget(exportWidget) centralWidget.layout().addWidget(self.saveWidget) centralWidget.layout().addWidget(buttonBox) self.setCentralWidget(centralWidget) self.setWindowTitle("ueExportAnimCache [*]") self.setExport() buttonBox.accepted.connect(self.export) buttonBox.rejected.connect(self.close)
def __init__(self, parent=ueMaya.getMayaWindow()): QtGui.QMainWindow.__init__(self, parent) ueCommonSave.setClasses([]) self.exportMenu = QtGui.QListWidget() self.itemMenu = QtGui.QListWidget() self.itemMenu.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) self.exportAsSeparateElements = QtGui.QCheckBox( "Export selection as seperate elements?") self.exportAsSeparateElements.setChecked(False) self.exportCache = QtGui.QCheckBox("Export cache?") self.exportCache.setChecked(True) for et in __exportTypes__: self.exportMenu.addItem(QtGui.QListWidgetItem(et)) exportWidget = QtGui.QGroupBox("Export") exportWidget.setLayout(QtGui.QGridLayout()) exportOptionsWidget = QtGui.QGroupBox("Export Options") exportOptionsWidget.setLayout(QtGui.QVBoxLayout()) exportWidget.layout().addWidget(QtGui.QLabel("Export"), 0, 0) exportWidget.layout().addWidget(self.exportMenu, 1, 0) exportWidget.layout().addWidget(QtGui.QLabel("Item"), 0, 1) exportWidget.layout().addWidget(self.itemMenu, 1, 1) exportOptionsWidget.layout().addWidget(self.exportAsSeparateElements) exportOptionsWidget.layout().addWidget(self.exportCache) self.saveWidget = ueCommonSave.Save() buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) centralWidget = QtGui.QWidget() centralWidget.setLayout(QtGui.QVBoxLayout()) centralWidget.layout().addWidget(exportWidget) centralWidget.layout().addWidget(exportOptionsWidget) centralWidget.layout().addWidget(self.saveWidget) centralWidget.layout().addWidget(buttonBox) self.setCentralWidget(centralWidget) self.setWindowTitle("ueExport [*]") self.exportMenu.setCurrentItem( self.exportMenu.findItems(selected, QtCore.Qt.MatchExactly)[0]) self.setExport() buttonBox.accepted.connect(self.export) buttonBox.rejected.connect(self.close) self.exportMenu.itemSelectionChanged.connect(self.setExport)
def __init__(self, parent=ueMaya.getMayaWindow()): QtGui.QMainWindow.__init__(self, parent) ueCommonSave.setClasses([]) self.exportMenu = QtGui.QListWidget() self.itemMenu = QtGui.QListWidget() self.itemMenu.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.exportAsSeparateElements = QtGui.QCheckBox("Export selection as seperate elements?") self.exportAsSeparateElements.setChecked(False) self.exportCache = QtGui.QCheckBox("Export cache?") self.exportCache.setChecked(True) for et in __exportTypes__: self.exportMenu.addItem(QtGui.QListWidgetItem(et)) exportWidget = QtGui.QGroupBox("Export") exportWidget.setLayout(QtGui.QGridLayout()) exportOptionsWidget = QtGui.QGroupBox("Export Options") exportOptionsWidget.setLayout(QtGui.QVBoxLayout()) exportWidget.layout().addWidget(QtGui.QLabel("Export"), 0, 0) exportWidget.layout().addWidget(self.exportMenu, 1, 0) exportWidget.layout().addWidget(QtGui.QLabel("Item"), 0, 1) exportWidget.layout().addWidget(self.itemMenu, 1, 1) exportOptionsWidget.layout().addWidget(self.exportAsSeparateElements) exportOptionsWidget.layout().addWidget(self.exportCache) self.saveWidget = ueCommonSave.Save() buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok| QtGui.QDialogButtonBox.Cancel) centralWidget = QtGui.QWidget() centralWidget.setLayout(QtGui.QVBoxLayout()) centralWidget.layout().addWidget(exportWidget) centralWidget.layout().addWidget(exportOptionsWidget) centralWidget.layout().addWidget(self.saveWidget) centralWidget.layout().addWidget(buttonBox) self.setCentralWidget(centralWidget) self.setWindowTitle("ueExport [*]") self.exportMenu.setCurrentItem(self.exportMenu.findItems(selected, QtCore.Qt.MatchExactly)[0]) self.setExport() buttonBox.accepted.connect(self.export) buttonBox.rejected.connect(self.close) self.exportMenu.itemSelectionChanged.connect(self.setExport)
def ueSaveWrite(): p = nukescripts.registerWidgetAsPanel("ueCommonSave.Save", "ueSave", "ue.panel.ueSave", create=True) p.setMinimumSize(400, 600) ueCommonSave.setClasses(__ueclasses_write__) if p.showModalDialog(): spec, dbMeta = ueCommonSave.getValues() n = nuke.thisNode() n.knob("proj").setValue(spec.proj) n.knob("grp").setValue(spec.grp) n.knob("asst").setValue(spec.asst) n.knob("elclass").setValue(spec.elclass) n.knob("eltype").setValue(spec.eltype) n.knob("elname").setValue(spec.elname) nukescripts.unregisterPanel("ue.panel.ueSave", lambda: "return")
def __init__(self, parent=ueMaya.getMayaWindow()): QtGui.QMainWindow.__init__(self, parent) ueCommonSave.setClasses(__ueclasses__) self.saveWidget = ueCommonSave.Save() self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) centralWidget = QtGui.QWidget() centralWidget.setLayout(QtGui.QVBoxLayout()) centralWidget.layout().addWidget(self.saveWidget) centralWidget.layout().addWidget(self.buttonBox) self.setCentralWidget(centralWidget) self.setWindowTitle("ueSave [*]") self.buttonBox.accepted.connect(self.save) self.buttonBox.rejected.connect(self.close)
def __init__(self, parent=ueMaya.getMayaWindow()): QtGui.QMainWindow.__init__(self, parent) ueCommonSave.setClasses(__ueclasses__) self.saveWidget = ueCommonSave.Save() self.buttonBox = QtGui.QDialogButtonBox( QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) centralWidget = QtGui.QWidget() centralWidget.setLayout(QtGui.QVBoxLayout()) centralWidget.layout().addWidget(self.saveWidget) centralWidget.layout().addWidget(self.buttonBox) self.setCentralWidget(centralWidget) self.setWindowTitle("ueSave [*]") self.buttonBox.accepted.connect(self.save) self.buttonBox.rejected.connect(self.close)
def ueSaveAs(): # if not ueNuke.ueScriptSanityCheck(): # return app = QtGui.QApplication.allWidgets() i = 0 for widget in app: if str(type(widget)) == "<class 'PyQt4.QtGui.QStackedWidget'>": name = "ueSaveThumbs_%04d.png" % i QtGui.QPixmap.grabWindow(widget.winId()).save(os.path.join(os.getenv("ASST_ROOT"), "tmp", name), "png") i += 1 p = nukescripts.registerWidgetAsPanel("ueCommonSave.Save", "ueSave", "ue.panel.ueSave", create=True) p.setMinimumSize(400, 600) ueCommonSave.setClasses(__ueclasses__) if p.showModalDialog(): spec, dbMeta = ueCommonSave.getValues() ueNukeUtils.saveUtility(spec, dbMeta=dbMeta) ueFileUtils.deleteFiles(os.path.join(os.path.join(os.getenv("ASST_ROOT"), "tmp", "ueSaveThumbs_*.png"))) nukescripts.unregisterPanel("ue.panel.ueSave", lambda: "return")