mirror of
https://github.com/Escartem/AnimeWwise.git
synced 2026-06-16 07:40:23 +08:00
fix bug and add subfolders
This commit is contained in:
10
app.py
10
app.py
@@ -54,7 +54,6 @@ class BackgroundWorker(QObject):
|
|||||||
def run(self):
|
def run(self):
|
||||||
if self.action == "load":
|
if self.action == "load":
|
||||||
print("Loading files and mapping if necessary...")
|
print("Loading files and mapping if necessary...")
|
||||||
self.currentInput = self.input
|
|
||||||
fileStructure = self.extract.load_folder(self.map, self.input, self.diff, progress=self.progress.emit)
|
fileStructure = self.extract.load_folder(self.map, self.input, self.diff, progress=self.progress.emit)
|
||||||
if fileStructure is None:
|
if fileStructure is None:
|
||||||
self.finished.emit({"action": "error", "content": {"msg": "Nothing found !", "state": 1}})
|
self.finished.emit({"action": "error", "content": {"msg": "Nothing found !", "state": 1}})
|
||||||
@@ -244,7 +243,10 @@ class AnimeWwise(QMainWindow):
|
|||||||
self.setFolder(folder="input")
|
self.setFolder(folder="input")
|
||||||
files = []
|
files = []
|
||||||
if self.folders["input"]:
|
if self.folders["input"]:
|
||||||
files = [os.path.join(self.folders["input"], f) for f in os.listdir(self.folders["input"]) if f.endswith(".pck")]
|
if self.pckSubFold.isChecked():
|
||||||
|
files = [os.path.join(root, f) for root, dirs, files_in_dir in os.walk(self.folders["input"]) for f in files_in_dir if f.endswith(".pck")]
|
||||||
|
else:
|
||||||
|
files = [os.path.join(self.folders["input"], f) for f in os.listdir(self.folders["input"]) if f.endswith(".pck")]
|
||||||
elif self.loadType == "file":
|
elif self.loadType == "file":
|
||||||
path = QFileDialog.getOpenFileName(self, "Select .pck File", "", "PCK Files (*.pck)", options=QFileDialog.Options())
|
path = QFileDialog.getOpenFileName(self, "Select .pck File", "", "PCK Files (*.pck)", options=QFileDialog.Options())
|
||||||
files = [path[0]]
|
files = [path[0]]
|
||||||
@@ -253,6 +255,10 @@ class AnimeWwise(QMainWindow):
|
|||||||
QMessageBox.warning(None, "Warning", "Nothing to load !", QMessageBox.Ok)
|
QMessageBox.warning(None, "Warning", "Nothing to load !", QMessageBox.Ok)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.currentInput = self.folders["input"]
|
||||||
|
if not self.folders["input"]:
|
||||||
|
self.currentInput = os.path.dirname(path[0])
|
||||||
|
|
||||||
_map = self.assetMap.currentIndex()
|
_map = self.assetMap.currentIndex()
|
||||||
if _map != 0:
|
if _map != 0:
|
||||||
_map = self.maps["maps"][_map-1]["name"]
|
_map = self.maps["maps"][_map-1]["name"]
|
||||||
|
|||||||
@@ -25,10 +25,9 @@ class WwiseExtract:
|
|||||||
self.steps = 1
|
self.steps = 1
|
||||||
self.mapper = None
|
self.mapper = None
|
||||||
if _map is not None:
|
if _map is not None:
|
||||||
self.mapper = Mapper(path(cwd, f"maps/{_map}"))
|
self.mapper = Mapper(path(cwd, f"maps/{_map}")) # TODO: load maps once
|
||||||
self.file_structure = {"folders": {}, "files": []}
|
self.file_structure = {"folders": {}, "files": []}
|
||||||
|
|
||||||
# files = [f for f in os.listdir(folder_path) if f.endswith(".pck")]
|
|
||||||
hdiff_files = []
|
hdiff_files = []
|
||||||
if diff_path != "":
|
if diff_path != "":
|
||||||
hdiff_files = [f for f in os.listdir(diff_path) if f.endswith(".pck.hdiff")]
|
hdiff_files = [f for f in os.listdir(diff_path) if f.endswith(".pck.hdiff")]
|
||||||
|
|||||||
Reference in New Issue
Block a user