コード例 #1
0
ファイル: h3dimport-gui.py プロジェクト: b0urb4k1/darkhammer
 def init_clips_jsonfile(self):
     global prefs
     in_filepath = str(self.edit_infilepath.text())
     in_jsonfile = util.make_samefname(in_filepath, in_filepath, 'json')
     if not os.path.isfile(in_jsonfile):
         # create an empty json clips file
         open(in_jsonfile, 'w').write('[{"name":"all"}]')
     self.in_jsonfile = in_jsonfile
コード例 #2
0
ファイル: h3dimport-gui.py プロジェクト: gwihlidal/darkhammer
 def init_clips_jsonfile(self):
     global prefs
     in_filepath = str(self.edit_infilepath.text())
     in_jsonfile = util.make_samefname(in_filepath, in_filepath, 'json')
     if not os.path.isfile(in_jsonfile):
         # create an empty json clips file
         open(in_jsonfile, 'w').write('[{"name":"all"}]')
     self.in_jsonfile = in_jsonfile
コード例 #3
0
ファイル: h3dimport-gui.py プロジェクト: gwihlidal/darkhammer
 def btn_browseinfile_click(self):
     dlg = QFileDialog(self, "Open physics", self.infiledir, \
         "Physx3 files (*.RepX)")
     dlg.setFileMode(QFileDialog.ExistingFile)
     if dlg.exec_():
         files = dlg.selectedFiles()
         self.edit_infilepath.setText(os.path.normpath(str(files[0])))
         self.infiledir = os.path.normpath(str(dlg.directory().path()))
         in_filepath = str(self.edit_infilepath.text())
         out_filepath = str(self.edit_outfilepath.text())
         self.edit_outfilepath.setText(util.make_samefname(out_filepath, in_filepath, "h3dp"))
         self.enum_phxobjects()
コード例 #4
0
ファイル: h3dimport-gui.py プロジェクト: b0urb4k1/darkhammer
 def btn_browseinfile_click(self):
     dlg = QFileDialog(self, "Open physics", self.infiledir, \
         "Physx3 files (*.RepX)")
     dlg.setFileMode(QFileDialog.ExistingFile)
     if dlg.exec_():
         files = dlg.selectedFiles()
         self.edit_infilepath.setText(os.path.normpath(str(files[0])))
         self.infiledir = os.path.normpath(str(dlg.directory().path()))
         in_filepath = str(self.edit_infilepath.text())
         out_filepath = str(self.edit_outfilepath.text())
         self.edit_outfilepath.setText(
             util.make_samefname(out_filepath, in_filepath, "h3dp"))
         self.enum_phxobjects()
コード例 #5
0
ファイル: h3dimport-gui.py プロジェクト: gwihlidal/darkhammer
 def browse_infile_clicked(self, checked):
     global prefs
     dlg = QFileDialog(self, "Open model", self.infile_dir, \
         "Models (*.dae *.obj *.x *.ase *.ms3d *.fbx)")
     dlg.setFileMode(QFileDialog.ExistingFile)
     if dlg.exec_():
         filepath = os.path.normcase(str(dlg.selectedFiles()[0]))
         self.edit_infilepath.setText(filepath)
         self.infile_dir = os.path.abspath(str(dlg.directory().path()))
         self.enum_models()
         # automatically set the name of the output file to the name of the input file
         in_filepath = str(self.edit_infilepath.text())
         out_filepath = str(self.edit_outfilepath.text())
         self.edit_outfilepath.setText(util.make_samefname(out_filepath, in_filepath, "h3dm"))
コード例 #6
0
ファイル: h3dimport-gui.py プロジェクト: b0urb4k1/darkhammer
 def browse_infile_clicked(self, checked):
     global prefs
     dlg = QFileDialog(self, "Open model", self.infile_dir, \
         "Models (*.dae *.obj *.x *.ase *.ms3d *.fbx)")
     dlg.setFileMode(QFileDialog.ExistingFile)
     if dlg.exec_():
         filepath = os.path.normcase(str(dlg.selectedFiles()[0]))
         self.edit_infilepath.setText(filepath)
         self.infile_dir = os.path.abspath(str(dlg.directory().path()))
         self.enum_models()
         # automatically set the name of the output file to the name of the input file
         in_filepath = str(self.edit_infilepath.text())
         out_filepath = str(self.edit_outfilepath.text())
         self.edit_outfilepath.setText(
             util.make_samefname(out_filepath, in_filepath, "h3dm"))
コード例 #7
0
ファイル: h3dimport-gui.py プロジェクト: gwihlidal/darkhammer
    def browse_infile_clicked(self):
        dlg = QFileDialog(self, "Open animation", self.infiledir, \
            "Animation files (*.dae *.obj *.x *.ase *.ms3d)")
        dlg.setFileMode(QFileDialog.ExistingFile)
        if dlg.exec_():
            files = dlg.selectedFiles()
            self.edit_infilepath.setText(os.path.normpath(str(files[0])))
            self.infiledir = os.path.normpath(str(dlg.directory().path()))
            in_filepath = str(self.edit_infilepath.text())
            out_filepath = str(self.edit_outfilepath.text())
            self.edit_outfilepath.setText(util.make_samefname(out_filepath, in_filepath, "h3da"))

            # try to locate clip (json) file in the same directory and same name as input file,
            # if not found, create an empty
            self.init_clips_jsonfile()
コード例 #8
0
ファイル: h3dimport-gui.py プロジェクト: b0urb4k1/darkhammer
    def browse_infile_clicked(self):
        dlg = QFileDialog(self, "Open animation", self.infiledir, \
            "Animation files (*.dae *.obj *.x *.ase *.ms3d)")
        dlg.setFileMode(QFileDialog.ExistingFile)
        if dlg.exec_():
            files = dlg.selectedFiles()
            self.edit_infilepath.setText(os.path.normpath(str(files[0])))
            self.infiledir = os.path.normpath(str(dlg.directory().path()))
            in_filepath = str(self.edit_infilepath.text())
            out_filepath = str(self.edit_outfilepath.text())
            self.edit_outfilepath.setText(
                util.make_samefname(out_filepath, in_filepath, "h3da"))

            # try to locate clip (json) file in the same directory and same name as input file,
            # if not found, create an empty
            self.init_clips_jsonfile()