7 pp
= p
.rsplit("/",1)[0]
8 os
.makedirs(f
"C:/squad_dump/{pp}", exist_ok
=1)
9 with
open(f
"C:/squad_dump/{p}.json", "w") as f
:
10 json
.dump(x
, f
, indent
=2)
14 expk
= ["deployables", "vehicles"]
15 if k
in expk
and "Object" in str(xx
):
17 res
= re
.sub("\(0x.*?\)", "", str(xx
))
18 return res
if len(res
) < 1024 else ""
24 if "method" not in ts
and a
[0] != "_":
25 if "Struct" in str(aa
) and dep
< 1:
26 d
[a
] = todict(aa
, dep
+ 1)
28 d
[a
] = [ps(bb
, a
) for bb
in aa
]
35 inst
= "C:/SquadEditor/Squad/Content"
37 "Blueprints/Items/GrenadeLaunchers",
38 "Blueprints/Items/Grenades",
39 "Blueprints/Items/MachineGuns",
40 "Blueprints/Items/Pistols",
41 "Blueprints/Items/Projectiles",
42 "Blueprints/Items/Rifles",
43 "Blueprints/Items/RocketLaunchers",
44 "Blueprints/Items/SubmachineGuns",
47 for w
in glob(f
"{inst}/{path}/**/BP_*.uasset", recursive
= True):
48 bp
= w
.split("\\", 1)[1].replace("\\", "/")[:-7]
49 bpp
= bp
.rsplit("/", 1)
50 b
= unreal
.load_object(None, f
"/Game/{path}/{bp}.{bpp[-1]}_C")
51 b
= unreal
.get_default_object(b
)
52 jd(todict(b
, 0), f
"{path}/{bp}")
53 paths
= ["Settings/Roles", "Settings/FactionSetups"]
55 for w
in glob(f
"{inst}/{path}/**/*.uasset", recursive
= True):
56 bp
= w
.split("\\", 1)[1].replace("\\", "/")[:-7]
57 b
= unreal
.load_object(None, f
"/Game/{path}/{bp}")
58 jd(todict(b
, 0), f
"{path}/{bp}")