forked from RBLXDecomp/RBXGSdecomp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.py
More file actions
45 lines (34 loc) · 1.32 KB
/
configure.py
File metadata and controls
45 lines (34 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import json
import argparse
from pathlib import Path
root = Path(__file__).parent
parser = argparse.ArgumentParser()
parser.add_argument("targetPath", help="The directory to your target object files.")
def configure(desiredTargetPath):
targetPath = root / desiredTargetPath
basePath = root / "Client/App/obj/ReleaseAssert"
if not targetPath.is_dir():
print("Specified target directory does not exist.")
return
# TODO: categorize objects by which folder theyre in
config = {
"$schema": "https://raw.githubusercontent.com/encounter/objdiff/main/config.schema.json",
"build_base": False,
"units": [],
}
objects = list(f for f in targetPath.iterdir() if f.is_file())
with open("objdiff.json", "w", encoding='utf-8') as file:
for i, targetObj in enumerate(objects):
objName = targetObj.name
config["units"].append({
"name": targetObj.stem,
"target_path": str(targetPath / objName)
})
if basePath.joinpath(objName).is_file():
config["units"][i].update({
"base_path": str(basePath / objName)
})
json.dump(config, file, indent=4)
if __name__ == "__main__":
args = parser.parse_args()
configure(args.targetPath)