コード例 #1
0
    def accept(self):
        """
        Check the connection.
        """
        cur_project = self.cmbProject.currentText()
        cur_shot = self.cmbShot.currentText()

        log.info("Setting project to " + cur_project)
        log.info("Setting shot to " + cur_shot)

        osplus.set_env("EPP_CURPROJECT", cur_project)
        osplus.set_env("EPP_CURSHOT", cur_shot)

        _fu = fu_controller()

        if not _fu.status(True):
            # No need for a dialog
            log.error("Fusion not running.", False)
        else:
            COMP_ROOT_DIR = shot_id_path(cur_project, cur_shot, "compositions")
            if os.path.isdir(COMP_ROOT_DIR):
                res = _fu.set_pathmap("Comps:", COMP_ROOT_DIR)
                log.info("Setting Comps: PathMap to {0} ({1})".format(
                    COMP_ROOT_DIR, res[1]))

        super(SetShotDialog, self).accept()
コード例 #2
0
def install(args):
    """docstring for install"""

    if not confirm_install(args):
        return False
    
    if "project_dir" in args and args["project_dir"] is not None:
        overwrite = install_epp(args)
        if not os.path.isdir(args["project_dir"]):
            os.path.makedirs(args["project_dir"])

    print "Setting environment variable ..."
    osplus.set_env("EPP_ROOT", args["install_path"])
    #osplus.set_env("EPP_PROJECT_ROOT", args["project_dir"])

    # TODO Install fu, gen scripts
    if "formats_import_filepath" in args and args["formats_import_filepath"] is not None:
        print "Importing format ..."
        format_filepath = os.path.join(args["install_path"], "templates", "formats.xml")
        if os.path.isfile(format_filepath) and overwrite:
            print ("Deleting old Formats ...")
            os.remove(format_filepath)
        if not os.path.isfile(format_filepath): 
            print ("Import Formats from Fusion ...")
        else:            
            print ("Appending Formats from Fusion ...")
        import_formats(args["formats_import_filepath"], format_filepath)
        print "Done."        
    
    print "Installing scripts ..."
    if "gen_script_dir" in args and args["gen_script_dir"] is not None and os.path.isdir(args["gen_script_dir"]):
        gen_src_dir = osplus.app_path("_scripts", "gen")
        copy_tree(gen_src_dir, args["gen_script_dir"])
        print "Copying Generation scripts ..."
    else:
        print "Could not copy Generation scripts."

    if args["fu_script_dir"] is not None and os.path.isdir(args["fu_script_dir"]):
        gen_src_dir = osplus.app_path("_scripts", "fu")
        copy_tree(gen_src_dir, args["fu_script_dir"])
        print "Copying Fusion scripts ..."
    else:
        print "Could not copy Fusion scripts."
    print "Done."        

    # Copy exe to bin.
    if hasattr(sys, 'frozen'):
        eppbindir = os.path.join(args["install_path"], "bin")
        if not os.path.isdir(eppbindir):
            os.makedirs(eppbindir)

        copy_tree(osplus.app_path(), eppbindir)

    return True        
コード例 #3
0
    def accept(self):
        """
        Check the connection.
        """

        _fu = fu_controller()

        if not _fu.status(True):
            log.error("Fusion not running.", True)
            return

        if os.path.isfile(self.COMP_FILEPATH):
            ret = QMessageBox.information(
                self, "Question",
                "Composition does already exist.\nOverwrite '{0}'".format(
                    os.path.basename(self.COMP_FILEPATH)),
                QMessageBox.Yes | QMessageBox.No)
            if ret == QMessageBox.No:
                return

        cur_project = self.cmbProject.currentText()
        cur_shot = self.cmbShot.currentText()

        ret = _fu.save_comp(self.COMP_FILEPATH, {
            "project": str(cur_project),
            "shot": str(cur_shot)
        })

        if not ret[0]:
            log.error(ret[1], True)
            return

        log.info("Saved Comp to {0}".format(self.COMP_FILEPATH))
        self.hide()

        if self.chkUpdateSavers.isChecked():
            ret = _fu.update_savers(self.spnVersion.value())

        if self.chkFormat.isChecked():
            _fu.set_format(project_format_object(cur_project))

        osplus.set_env("EPP_CURPROJECT", self.cmbProject.currentText())
        osplus.set_env("EPP_CURSHOT", self.cmbShot.currentText())

        COMP_ROOT_DIR = os.path.dirname(self.COMP_FILEPATH)
        if os.path.isdir(COMP_ROOT_DIR):
            res = _fu.set_pathmap("Comps:", COMP_ROOT_DIR)
            log.info("Setting Comps: PathMap to {0} ({1})".format(
                COMP_ROOT_DIR, res[1]))

        super(SaveAsDialog, self).accept()
コード例 #4
0
    def accept(self):
        """
        Check the connection.
        """

        _fu = fu_controller()

        if not _fu.status(True):
            QMessageBox.critical(self, "Error", "Fusion not running.")
            return

        if os.path.isfile(self.COMP_FILEPATH):
            ret = QMessageBox.information(
                self, "Question",
                "Composition does already exist.\nOverwrite '{0}'".format(
                    os.path.basename(self.COMP_FILEPATH)),
                QMessageBox.Yes | QMessageBox.No)
            if ret == QMessageBox.No:
                return

        cur_project = self.cmbProject.currentText()
        cur_shot = self.cmbShot.currentText()

        ret = _fu.save_comp(self.COMP_FILEPATH, {
            "project": str(cur_project),
            "shot": str(cur_shot)
        })

        if not ret[0]:
            QMessageBox.critical(self, "Error", ret[1])
            return

        self.hide()

        if self.chkUpdateSavers.isChecked():
            ret = _fu.update_savers(self.spnVersion.value())

        if self.chkFormat.isChecked():
            _fu.set_format(project_format_object(cur_project))

        osplus.set_env("EPP_CURPROJECT", self.cmbProject.currentText())
        osplus.set_env("EPP_CURSHOT", self.cmbShot.currentText())

        super(SaveAsDialog, self).accept()
コード例 #5
0
ファイル: save_as.py プロジェクト: eyeonSoftware/epp
    def accept(self):
        """
        Check the connection.
        """

        _fu = fu_controller()

        if not _fu.status(True):
            log.error("Fusion not running.", True)
            return

        if os.path.isfile(self.COMP_FILEPATH):
            ret = QMessageBox.information(self, "Question", "Composition does already exist.\nOverwrite '{0}'".format(os.path.basename(self.COMP_FILEPATH)), QMessageBox.Yes | QMessageBox.No)
            if ret == QMessageBox.No:
                return

        cur_project = self.cmbProject.currentText()
        cur_shot = self.cmbShot.currentText()

        ret = _fu.save_comp(self.COMP_FILEPATH, {"project": str(cur_project), "shot": str(cur_shot)})

        if not ret[0]:
            log.error(ret[1], True)
            return

        log.info("Saved Comp to {0}".format(self.COMP_FILEPATH))
        self.hide()

        if self.chkUpdateSavers.isChecked():
            ret = _fu.update_savers(self.spnVersion.value())

        if self.chkFormat.isChecked():
            _fu.set_format(project_format_object(cur_project))

        osplus.set_env("EPP_CURPROJECT", self.cmbProject.currentText())
        osplus.set_env("EPP_CURSHOT", self.cmbShot.currentText())

        COMP_ROOT_DIR = os.path.dirname(self.COMP_FILEPATH)
        if os.path.isdir(COMP_ROOT_DIR):
            res = _fu.set_pathmap("Comps:", COMP_ROOT_DIR)
            log.info("Setting Comps: PathMap to {0} ({1})".format(COMP_ROOT_DIR, res[1]))

        super(SaveAsDialog, self).accept()
コード例 #6
0
ファイル: base_projectshot.py プロジェクト: eyeonSoftware/epp
    def accept(self):
        """
        Check the connection.
        """

        _fu = fu_controller()

        if not _fu.status(True):
            QMessageBox.critical(self, "Error", "Fusion not running.")
            return

        if os.path.isfile(self.COMP_FILEPATH):
            ret = QMessageBox.information(self, "Question", "Composition does already exist.\nOverwrite '{0}'".format(os.path.basename(self.COMP_FILEPATH)), QMessageBox.Yes | QMessageBox.No)
            if ret == QMessageBox.No:
                return

        cur_project = self.cmbProject.currentText()
        cur_shot = self.cmbShot.currentText()

        ret = _fu.save_comp(self.COMP_FILEPATH, {"project": str(cur_project), "shot": str(cur_shot)})

        if not ret[0]:
            QMessageBox.critical(self, "Error", ret[1])
            return

        self.hide()

        if self.chkUpdateSavers.isChecked():
            ret = _fu.update_savers(self.spnVersion.value())

        if self.chkFormat.isChecked():
            _fu.set_format(project_format_object(cur_project))

        osplus.set_env("EPP_CURPROJECT", self.cmbProject.currentText())
        osplus.set_env("EPP_CURSHOT", self.cmbShot.currentText())

        super(SaveAsDialog, self).accept()