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

22 lines
998 B
Python

import json
import os
import unreal
REPORT_PATH = os.path.join(unreal.Paths.project_dir(), "VehicleExports", "unreal_skeletal_mesh_python_api_report.json")
mesh = unreal.load_asset("/Game/MrPlow/Vehicles/Kamaz/SK_Kamaz_Chassis.SK_Kamaz_Chassis")
skeleton = mesh.get_editor_property("skeleton")
report = {
"meshClass": mesh.get_class().get_name(),
"meshMethods": [name for name in dir(mesh) if "bone" in name.lower() or "skel" in name.lower() or "socket" in name.lower() or "bound" in name.lower() or "ref" in name.lower()],
"skeletonClass": skeleton.get_class().get_name() if skeleton else None,
"skeletonMethods": [name for name in dir(skeleton) if "bone" in name.lower() or "skel" in name.lower() or "socket" in name.lower() or "ref" in name.lower()] if skeleton else [],
}
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))