Example #1
0
    def import_clicked(self, checked):
        global prefs
        name = str(self.combo_names.itemText(self.combo_names.currentIndex()))
        occname = ""
        if self.combo_occ.currentIndex() != 0:
            occname = str(
                self.combo_occ.itemText(self.combo_occ.currentIndex()))
        infilepath = str(self.edit_infilepath.text())
        outfilepath = os.path.normcase(prefs['assetdir'] + '/' +
                                       str(self.edit_outfilepath.text()))
        texdir = os.path.normcase(prefs['assetdir'] + '/' +
                                  str(self.edit_texdir.text()))
        texdir_alias = util.valid_engine_path(str(self.edit_texdir.text()))
        calctng = self.check_calctng.isChecked()
        fastcompress = self.check_fastcompress.isChecked()
        forcedxt3 = self.check_dxt3.isChecked()
        scale = self.edit_scale.text().toFloat()[0]
        if scale <= 0: scale = 1

        args = [prefs['binpath']]
        if prefs['verbose']: args.extend(["-v"])
        if name != "": args.extend(["-n", name])
        if infilepath != "": args.extend(["-m", infilepath])
        if outfilepath != "": args.extend(["-o", outfilepath])
        if texdir != "": args.extend(["-tdir", texdir])
        if texdir_alias != "": args.extend(["-talias", texdir_alias])
        if calctng: args.extend(["-calctng"])
        if fastcompress: args.extend(["-tfast"])
        if forcedxt3: args.extend(["-tdxt3"])
        if len(occname) > 0: args.extend(["-occ", occname])
        if self.quiet_mode: args.extend(["-toff"])
        if scale != 1: args.extend(["-scale", str(scale)])

        print args

        # call h3dimport command
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
        r = subprocess.call(args)
        QApplication.restoreOverrideCursor()
        if r == -1 and not self.quiet_mode:
            QMessageBox.critical(self, "h3dimport", """Failed to import file, see the""" \
                                       """ terminal for more info""")
Example #2
0
    def import_clicked(self, checked):
        global prefs
        name = str(self.combo_names.itemText(self.combo_names.currentIndex()))
        occname = ""
        if self.combo_occ.currentIndex() != 0:
            occname = str(self.combo_occ.itemText(self.combo_occ.currentIndex()))
        infilepath = str(self.edit_infilepath.text())
        outfilepath = os.path.normcase(prefs['assetdir'] + '/' + str(self.edit_outfilepath.text()))
        texdir = os.path.normcase(prefs['assetdir'] + '/' + str(self.edit_texdir.text()))
        texdir_alias = util.valid_engine_path(str(self.edit_texdir.text()))
        calctng = self.check_calctng.isChecked()
        fastcompress = self.check_fastcompress.isChecked()
        forcedxt3 = self.check_dxt3.isChecked()
        scale = self.edit_scale.text().toFloat()[0]
        if scale <= 0:  scale = 1

        args = [prefs['binpath']]
        if prefs['verbose']:    args.extend(["-v"])
        if name != "":          args.extend(["-n", name])
        if infilepath != "":    args.extend(["-m", infilepath])
        if outfilepath != "":   args.extend(["-o", outfilepath])
        if texdir != "":        args.extend(["-tdir", texdir])
        if texdir_alias != "":  args.extend(["-talias", texdir_alias])
        if calctng:             args.extend(["-calctng"])
        if fastcompress:        args.extend(["-tfast"])
        if forcedxt3:           args.extend(["-tdxt3"])
        if len(occname) > 0:    args.extend(["-occ", occname])
        if self.quiet_mode:     args.extend(["-toff"])
        if scale != 1:          args.extend(["-scale", str(scale)])

        print args

        # call h3dimport command
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
        r = subprocess.call(args)
        QApplication.restoreOverrideCursor()
        if r == -1 and not self.quiet_mode:
            QMessageBox.critical(self, "h3dimport", """Failed to import file, see the""" \
                                       """ terminal for more info""")
Example #3
0
    def import_texture(self, tex_filepath, tex_type):
        global prefs
        texdir = os.path.normcase(prefs['assetdir'] + '/' + str(self.edit_texdir.text()))
        texdir_alias = util.valid_engine_path(str(self.edit_texdir.text()))
        calctng = self.check_calctng.isChecked()
        fastcompress = self.check_fastcompress.isChecked()
        forcedxt3 = self.check_dxt3.isChecked()
        args = [prefs['binpath']]
        if tex_filepath != "":  args.extend(["-t", tex_filepath])
        if texdir != "":        args.extend(["-tdir", texdir])
        if fastcompress:        args.extend(["-tfast"])
        if forcedxt3:           args.extend(["-tdxt3"])
        args.extend(["-ttype", str(tex_type)])

        # call h3dimport command
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
        r = subprocess.call(args)
        QApplication.restoreOverrideCursor()
        if r == -1 and not self.quiet_mode:
            QMessageBox.critical(self, "h3dimport", """Failed to import file, see the"""\
                                       """ terminal for more info""")
        self.watcher.addPaths(self.textures.keys())
Example #4
0
    def import_texture(self, tex_filepath, tex_type):
        global prefs
        texdir = os.path.normcase(prefs['assetdir'] + '/' +
                                  str(self.edit_texdir.text()))
        texdir_alias = util.valid_engine_path(str(self.edit_texdir.text()))
        calctng = self.check_calctng.isChecked()
        fastcompress = self.check_fastcompress.isChecked()
        forcedxt3 = self.check_dxt3.isChecked()
        args = [prefs['binpath']]
        if tex_filepath != "": args.extend(["-t", tex_filepath])
        if texdir != "": args.extend(["-tdir", texdir])
        if fastcompress: args.extend(["-tfast"])
        if forcedxt3: args.extend(["-tdxt3"])
        args.extend(["-ttype", str(tex_type)])

        # call h3dimport command
        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
        r = subprocess.call(args)
        QApplication.restoreOverrideCursor()
        if r == -1 and not self.quiet_mode:
            QMessageBox.critical(self, "h3dimport", """Failed to import file, see the"""\
                                       """ terminal for more info""")
        self.watcher.addPaths(self.textures.keys())