mrPlow58/Tools/Unreal/inspect_unreal_python_world_partition_api.py
2026-06-19 22:02:21 +03:00

23 lines
858 B
Python

import json
import os
import unreal
REPORT_PATH = os.path.join(unreal.Paths.project_dir(), "VehicleExports", "unreal_python_world_partition_api_report.json")
names = [name for name in dir(unreal) if "WorldPartition" in name or "Partition" in name]
subsystem_info = {}
for name in names:
obj = getattr(unreal, name)
if isinstance(obj, type):
methods = [method for method in dir(obj) if "cell" in method.lower() or "load" in method.lower() or "partition" in method.lower() or "world" in method.lower()]
if methods:
subsystem_info[name] = methods
report = {"names": names, "classesWithRelevantMethods": subsystem_info}
os.makedirs(os.path.dirname(REPORT_PATH), exist_ok=True)
with open(REPORT_PATH, "w", encoding="utf-8") as report_file:
json.dump(report, report_file, indent=2)
print(json.dumps(report, indent=2))