Beispiel #1
0
    def test(self):
        if self.frame.m_dirPicker6.GetPath() != '':
            self.new_fold = self.frame.m_dirPicker6.Path
            self.new_fold_list = function.all_file_path(self.new_fold)
        if self.frame.m_dirPicker_old.GetPath() != '':
            self.old_fold = self.frame.m_dirPicker_old.GetPath()
            self.old_fold_list = function.all_file_path(self.old_fold)

        if self.new_fold != '' and self.old_fold != '':
            self.start()
Beispiel #2
0
    def export_all(self, path):
        if self.setting["new_dir"]:
            path += r"\碧蓝航线-导出"

        os.makedirs(path, exist_ok=True)

        self.restart()
        self.save_path = path
        self.form.m_gauge_all.SetValue(0)

        if self.full["skip_had"]:
            self.save_path_list = function.all_file_path(self.save_path)

            self.skip = self.info.build_skip(self.save_path_list[1])

        self.form.m_listBox_skip.Clear()
        self.form.m_listBox_skip.Set(self.skip.for_show)

        self.restore.add_save_path(self.save_path)
        self.restore.update_value(self.able, self.unable)
        if self.restore.is_alive():
            self.restore.stop_(True)
            while self.restore.is_alive():
                time.sleep(1)
            self.restore.start()
        else:
            self.restore.start()
Beispiel #3
0
    def drop_work(
        self,
        file_names,
    ):
        try:
            file_names = list(file_names)
            self.form.m_staticText_load_tex.SetLabel('开始')
            self.form.m_staticText_mesh_load.SetLabel('开始')

            dir_name = (filter(lambda x: not os.path.isfile(x), file_names))
            dir_name = map(lambda x: function.all_file_path(x)[1].values(),
                           dir_name)
            list(map(lambda x: file_names.extend(x), dir_name))

            file_names = (filter(lambda x: os.path.isfile(x), file_names))

            if self.full['clear_list']:
                self.info.clear()

            paths = list(
                filter(
                    lambda x: re.match(r'^UISprite\s#\d+\.png$',
                                       os.path.basename(x)) is None,
                    file_names))

            returned_tex, tex_info = tools.file_deal2(paths, self.info,
                                                      self.full['clear_list'],
                                                      self.pattern_tex, True,
                                                      '', self.names,
                                                      self.tex_type)

            returned_mesh, mesh_info = tools.file_deal2(
                paths, self.info, self.full['clear_list'], self.pattern_mesh,
                True, "-mesh", self.names, self.mesh_type)
            if returned_tex:
                self.form.m_gauge_tex_load.SetValue(100)

                self.form.m_listBox_tex.Set(self.info.for_show)
            self.form.m_staticText_load_tex.SetLabel(tex_info)
            if returned_mesh:
                self.form.m_gauge_mesh_load.SetValue(100)

                self.form.m_listBox_mesh.Set(self.info.for_show)
            self.form.m_staticText_mesh_load.SetLabel(mesh_info)

            self.info_check()

        except RuntimeError as info:
            return False, info

        else:
            return True, ''
Beispiel #4
0
    def load_tex_and_mesh(self):
        self.form.m_gauge_tex_load.SetValue(0)
        self.__dialog = wx.DirDialog(self.form,
                                     "打开",
                                     os.getcwd(),
                                     style=wx.DD_NEW_DIR_BUTTON
                                     | wx.DD_CHANGE_DIR | wx.DD_DEFAULT_STYLE
                                     | wx.DD_DIR_MUST_EXIST)

        if self.__dialog.ShowModal() == wx.ID_OK:
            paths = self.__dialog.GetPath()
            self.form.m_staticText_load_tex.SetLabel('开始')
            self.form.m_staticText_mesh_load.SetLabel('开始')

            paths = function.all_file_path(paths)[1]

            returned_tex, tex_info = tools.file_deal2(paths, self.info,
                                                      self.full['clear_list'],
                                                      self.pattern_tex, False,
                                                      '', self.names,
                                                      self.tex_type)

            returned_mesh, mesh_info = tools.file_deal2(
                paths, self.info, self.full['clear_list'], self.pattern_mesh,
                False, "-mesh", self.names, self.mesh_type)
            if returned_tex:
                self.form.m_gauge_tex_load.SetValue(100)

                self.form.m_listBox_tex.Set(self.info.for_show)
            self.form.m_staticText_load_tex.SetLabel(tex_info)
            if returned_mesh:
                self.form.m_gauge_mesh_load.SetValue(100)

                self.form.m_listBox_mesh.Set(self.info.for_show)
            self.form.m_staticText_mesh_load.SetLabel(mesh_info)

            address = self.__dialog.GetPath()
        else:
            address = 'None'

        self.info_check()

        return address
Beispiel #5
0
    def in_folder(self):
        self.frame.m_gauge_fold_in.SetValue(0)
        self.dialog = wx.DirDialog(self.frame,
                                   "打开",
                                   style=wx.DD_CHANGE_DIR
                                   | wx.DD_NEW_DIR_BUTTON
                                   | wx.DD_DIR_MUST_EXIST)

        if self.dialog.ShowModal() == wx.ID_OK:
            path = function.all_file_path(self.dialog.GetPath())[1]

            returned = tools.file_deal(path,
                                       self.in_show, [], [],
                                       self.path,
                                       pattern=r'^.+\.[Pp][Nn][Gg]$',
                                       is_file=False)

            if returned:
                self.frame.m_gauge_fold_in.SetValue(100)
                self.frame.m_listBox_pic_in.Clear()
                self.frame.m_listBox_pic_in.Set(self.in_show)
Beispiel #6
0
    def load_mesh_fold(self):
        self.form.m_gauge_tex_load.SetValue(0)
        if self.lock:
            address = self.default['default_mesh_dir']
        else:
            address = os.getcwd()

        self.__dialog = wx.DirDialog(self.form,
                                     "打开",
                                     address,
                                     style=wx.DD_NEW_DIR_BUTTON
                                     | wx.DD_CHANGE_DIR | wx.DD_DEFAULT_STYLE
                                     | wx.DD_DIR_MUST_EXIST)

        if self.__dialog.ShowModal() == wx.ID_OK:
            paths = self.__dialog.GetPath()
            self.form.m_staticText_mesh_load.SetLabel("开始")
            self.form.m_gauge_mesh_load.SetValue(0)

            paths = function.all_file_path(paths)[1]

            returned, info = tools.file_deal2(paths, self.info,
                                              self.full['clear_list'],
                                              self.pattern_mesh, False,
                                              "-mesh", self.names,
                                              self.mesh_type)
            if returned:
                self.form.m_gauge_mesh_load.SetValue(100)
                self.form.m_staticText_mesh_load.SetLabel(info)
                self.form.m_listBox_mesh.Set(self.info.for_show)
            self.form.m_staticText_mesh_load.SetLabel(info)
            address = self.__dialog.GetPath()
        else:
            address = 'None'

        self.info_check()

        return address
Beispiel #7
0
    def open_give(self, dir_address):

        files = function.all_file_path(dir_address)[1].values()
        # print(files)
        self.drop_work(files)