예제 #1
0
    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)
예제 #2
0
파일: Export.py 프로젝트: theomission/ue
    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)
예제 #3
0
파일: Export.py 프로젝트: hdd/ue
    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)
예제 #4
0
파일: Save.py 프로젝트: hdd/ue
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")
예제 #5
0
파일: Save.py 프로젝트: theomission/ue
    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)
예제 #6
0
    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)
예제 #7
0
    def export(self):
        spec, dbMeta = ueCommonSave.getValues()
        selection = []
        for i in self.itemMenu.selectedItems():
            selection.append(i.text())
        maya.cmds.select(selection, ne=True, r=True)
        ueMayaUtils.saveUtility(spec, dbMeta=dbMeta, fileType="obj", export=True, animated=True)
        spec.elclass = "ms"
        ueMayaUtils.saveUtility(spec, dbMeta=dbMeta, fileType="ma", export=True)
#        ueFileUtils.deleteFiles(os.path.join(os.path.join(os.getenv("ASST_ROOT"), "tmp", "ueSaveThumbs_*.png")))
        self.close()
예제 #8
0
파일: Save.py 프로젝트: hdd/ue
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")
예제 #9
0
 def save(self):
     spec, dbMeta = ueCommonSave.getValues()
     ueMayaUtils.saveUtility(spec, dbMeta=dbMeta)
     #        ueFileUtils.deleteFiles(os.path.join(os.path.join(os.getenv("ASST_ROOT"), "tmp", "ueSaveThumbs_*.png")))
     self.close()
예제 #10
0
파일: Save.py 프로젝트: theomission/ue
 def save(self):
     spec, dbMeta = ueCommonSave.getValues()
     ueMayaUtils.saveUtility(spec, dbMeta=dbMeta)
     #        ueFileUtils.deleteFiles(os.path.join(os.path.join(os.getenv("ASST_ROOT"), "tmp", "ueSaveThumbs_*.png")))
     self.close()
예제 #11
0
파일: Render.py 프로젝트: hdd/ue
    def save(self):
        spec, dbMeta = ueCommonSave.getValues()

        # Check if the scene has been saved       
        if maya.cmds.file(q=True, sn=True) == "":
            ueSave.ueSaveAs()

        sourceSpec = ueSpec.Spec(maya.cmds.fileInfo("ueproj", query=True)[0],
                                 maya.cmds.fileInfo("uegrp", query=True)[0],
                                 maya.cmds.fileInfo("ueasst", query=True)[0],
                                 maya.cmds.fileInfo("ueclass", query=True)[0],
                                 maya.cmds.fileInfo("uetype", query=True)[0],
                                 maya.cmds.fileInfo("uename", query=True)[0],
                                 int(maya.cmds.fileInfo("uevers", query=True)[0]))
        destSpec = spec

        # Create the element(s)/version(s) to render into
        dbMeta = {}
        if len(self.renderOpts[1]) > 1:
            dbMeta["passes"] = ",".join(self.renderOpts[1])
        dbMeta["comment"] = "Render from %s" % str(sourceSpec)

        e = ueAssetUtils.getElement(destSpec)
        if e == {}:
            e = ueCreate.createElement(destSpec, dbMeta=dbMeta)

        # If we're rendering into the last existing version, delete it
        if not renderOpts[2]["newVersion"]:
            versions = ueAssetUtils.getVersions(destSpec)
            destSpec.vers = len(versions)
            ueDestroy.destroyVersion(destSpec)

        if renderOpts[2]["clearLastVersion"]:
            print "deleting files"

        # Create a new version
        v = ueCreate.createVersion(destSpec, dbMeta=dbMeta)

        destSpec.vers = v["version"]

        path = v["path"]
        name = v["file_name"]

        # Set up the render globals
        maya.cmds.setAttr("defaultRenderGlobals.extensionPadding", 4)
        maya.cmds.setAttr("defaultRenderGlobals.putFrameBeforeExt", 1)
        if len(self.renderOpts[1]) == 1:
            p = os.path.join(path.replace(os.path.join(os.getenv("ASST_ROOT"), "render")+"/", ""), name)
            maya.cmds.setAttr("defaultRenderGlobals.imageFilePrefix", p, type="string")
        else:
            p = os.path.join(path.replace(os.path.join(os.getenv("ASST_ROOT"), "render")+\
                                          "/", ""), "<RenderPass", name+"_<RenderPass>")
            p = os.path.join("<RenderPass", name+"_<RenderPass>")
            maya.cmds.setAttr("defaultRenderGlobals.imageFilePrefix", p, type="string")

        dbMeta = {}
        dbMeta["comment"] = "Auto-save of render %s" % str(destSpec)

        ueMayaUtils.saveUtility(sourceSpec, dbMeta=dbMeta)
        ueMayaUtils.saveUtility(sourceSpec)

        if self.renderOpts[0] == 0:
            print "Rendering %s ..." % str(destSpec)
            maya.mel.eval("mayaBatchRender")
        elif self.renderOpts[0] == 1:
            print "Spooling %s ..." % str(destSpec)
        elif self.renderOpts[0] == 2:
            print "Spooling to cloud currently not avaliable"

        self.close()
예제 #12
0
파일: Export.py 프로젝트: theomission/ue
    def export(self):
        destSpec, dbMeta = ueCommonSave.getValues()

        fi = ueMaya.parseFileInfo(maya.cmds.fileInfo(query=True))

        sourceSpec = ueSpec.Spec(fi["ueproj"], fi["uegrp"], fi["ueasst"],
                                 fi["ueclass"], fi["uetype"], fi["uename"],
                                 fi["uevers"])

        dbMeta["comment"] = "Exported from %s" % str(sourceSpec)

        # Get the selected nodes from the dialog list
        selection = []
        for i in self.itemMenu.selectedItems():
            selection.append(str(i.text()))

        # If we're exporting all our seleted items into one element,
        # add the entire list into another list so when we iterate over
        # it, we return the list once and export everything
        if not self.exportAsSeparateElements.isChecked():
            newSelection = []
            newSelection.append(selection)
            selection = newSelection

        # Iterate over our selection and export
        if destSpec.elclass == "ms":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                ueMayaUtils.saveUtility(destSpec,
                                        dbMeta=dbMeta,
                                        fileType="ma",
                                        export=True)
        elif destSpec.elclass == "cam":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                destSpec.elclass = "ms"
                ueMayaUtils.saveUtility(destSpec,
                                        dbMeta=dbMeta,
                                        fileType="ma",
                                        export=True)
                if self.exportCache.isChecked():
                    destSpec.elclass = "cam"
                    ueMayaUtils.saveUtility(destSpec,
                                            dbMeta=dbMeta,
                                            fileType="fbx",
                                            export=True)
        elif destSpec.elclass == "lgt":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                destSpec.elclass = "ms"
                ueMayaUtils.saveUtility(destSpec,
                                        dbMeta=dbMeta,
                                        fileType="ma",
                                        export=True)
                if self.exportCache.isChecked():
                    destSpec.elclass = "lgt"
                    ueMayaUtils.saveUtility(destSpec,
                                            dbMeta=dbMeta,
                                            fileType="fbx",
                                            export=True)
        elif destSpec.elclass == "geo":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                destSpec.elclass = "ms"
                ueMayaUtils.saveUtility(destSpec,
                                        dbMeta=dbMeta,
                                        fileType="ma",
                                        export=True)
                if self.exportCache.isChecked():
                    destSpec.elclass = "geo"
                    ueMayaUtils.saveUtility(destSpec,
                                            dbMeta=dbMeta,
                                            fileType="obj",
                                            export=True)
        elif destSpec.elclass == "mrs":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                ueMayaUtils.saveUtility(destSpec,
                                        dbMeta=dbMeta,
                                        fileType="ma",
                                        export=True)

#        ueFileUtils.deleteFiles(os.path.join(os.path.join(os.getenv("ASST_ROOT"), "tmp", "ueSaveThumbs_*.png")))

        self.close()
예제 #13
0
파일: Export.py 프로젝트: hdd/ue
    def export(self):
        destSpec, dbMeta = ueCommonSave.getValues()

        fi = ueMaya.parseFileInfo(maya.cmds.fileInfo(query=True))

        sourceSpec = ueSpec.Spec(fi["ueproj"], fi["uegrp"], fi["ueasst"],
                                 fi["ueclass"], fi["uetype"], fi["uename"],
                                 fi["uevers"])

        dbMeta["comment"] = "Exported from %s" % str(sourceSpec)

        # Get the selected nodes from the dialog list
        selection = []
        for i in self.itemMenu.selectedItems():
            selection.append(str(i.text()))

        # If we're exporting all our seleted items into one element,
        # add the entire list into another list so when we iterate over
        # it, we return the list once and export everything
        if not self.exportAsSeparateElements.isChecked():
            newSelection = []
            newSelection.append(selection)
            selection = newSelection

        # Iterate over our selection and export
        if destSpec.elclass == "ms":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                ueMayaUtils.saveUtility(destSpec, dbMeta=dbMeta, fileType="ma", export=True)
        elif destSpec.elclass == "cam":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                destSpec.elclass = "ms"
                ueMayaUtils.saveUtility(destSpec, dbMeta=dbMeta, fileType="ma", export=True)
                if self.exportCache.isChecked():
                    destSpec.elclass = "cam"
                    ueMayaUtils.saveUtility(destSpec, dbMeta=dbMeta, fileType="fbx", export=True)
        elif destSpec.elclass == "lgt":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                destSpec.elclass = "ms"
                ueMayaUtils.saveUtility(destSpec, dbMeta=dbMeta, fileType="ma", export=True)
                if self.exportCache.isChecked():
                    destSpec.elclass = "lgt"
                    ueMayaUtils.saveUtility(destSpec, dbMeta=dbMeta, fileType="fbx", export=True)
        elif destSpec.elclass == "geo":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                destSpec.elclass = "ms"
                ueMayaUtils.saveUtility(destSpec, dbMeta=dbMeta, fileType="ma", export=True)
                if self.exportCache.isChecked():
                    destSpec.elclass = "geo"
                    ueMayaUtils.saveUtility(destSpec, dbMeta=dbMeta, fileType="obj", export=True)
        elif destSpec.elclass == "mrs":
            for item in selection:
                if self.exportAsSeparateElements.isChecked():
                    destSpec.elname = item.replace(":", "")
                maya.cmds.select(item, r=True)
                ueMayaUtils.saveUtility(destSpec, dbMeta=dbMeta, fileType="ma", export=True)

#        ueFileUtils.deleteFiles(os.path.join(os.path.join(os.getenv("ASST_ROOT"), "tmp", "ueSaveThumbs_*.png")))

        self.close()
예제 #14
0
파일: Render.py 프로젝트: theomission/ue
    def save(self):
        spec, dbMeta = ueCommonSave.getValues()

        # Check if the scene has been saved
        if maya.cmds.file(q=True, sn=True) == "":
            ueSave.ueSaveAs()

        sourceSpec = ueSpec.Spec(
            maya.cmds.fileInfo("ueproj", query=True)[0],
            maya.cmds.fileInfo("uegrp", query=True)[0],
            maya.cmds.fileInfo("ueasst", query=True)[0],
            maya.cmds.fileInfo("ueclass", query=True)[0],
            maya.cmds.fileInfo("uetype", query=True)[0],
            maya.cmds.fileInfo("uename", query=True)[0],
            int(maya.cmds.fileInfo("uevers", query=True)[0]))
        destSpec = spec

        # Create the element(s)/version(s) to render into
        dbMeta = {}
        if len(self.renderOpts[1]) > 1:
            dbMeta["passes"] = ",".join(self.renderOpts[1])
        dbMeta["comment"] = "Render from %s" % str(sourceSpec)

        e = ueAssetUtils.getElement(destSpec)
        if e == {}:
            e = ueCreate.createElement(destSpec, dbMeta=dbMeta)

        # If we're rendering into the last existing version, delete it
        if not renderOpts[2]["newVersion"]:
            versions = ueAssetUtils.getVersions(destSpec)
            destSpec.vers = len(versions)
            ueDestroy.destroyVersion(destSpec)

        if renderOpts[2]["clearLastVersion"]:
            print "deleting files"

        # Create a new version
        v = ueCreate.createVersion(destSpec, dbMeta=dbMeta)

        destSpec.vers = v["version"]

        path = v["path"]
        name = v["file_name"]

        # Set up the render globals
        maya.cmds.setAttr("defaultRenderGlobals.extensionPadding", 4)
        maya.cmds.setAttr("defaultRenderGlobals.putFrameBeforeExt", 1)
        if len(self.renderOpts[1]) == 1:
            p = os.path.join(
                path.replace(
                    os.path.join(os.getenv("ASST_ROOT"), "render") + "/", ""),
                name)
            maya.cmds.setAttr("defaultRenderGlobals.imageFilePrefix",
                              p,
                              type="string")
        else:
            p = os.path.join(path.replace(os.path.join(os.getenv("ASST_ROOT"), "render")+\
                                          "/", ""), "<RenderPass", name+"_<RenderPass>")
            p = os.path.join("<RenderPass", name + "_<RenderPass>")
            maya.cmds.setAttr("defaultRenderGlobals.imageFilePrefix",
                              p,
                              type="string")

        dbMeta = {}
        dbMeta["comment"] = "Auto-save of render %s" % str(destSpec)

        ueMayaUtils.saveUtility(sourceSpec, dbMeta=dbMeta)
        ueMayaUtils.saveUtility(sourceSpec)

        if self.renderOpts[0] == 0:
            print "Rendering %s ..." % str(destSpec)
            maya.mel.eval("mayaBatchRender")
        elif self.renderOpts[0] == 1:
            print "Spooling %s ..." % str(destSpec)
        elif self.renderOpts[0] == 2:
            print "Spooling to cloud currently not avaliable"

        self.close()