mrPlow58/Scripts/inspect_kamaz_cr_gate.py
2026-07-03 07:06:16 +03:00

20 lines
1.2 KiB
Python

import json, os
import unreal
mesh_path='/Game/MrPlow/Vehicles/KAMAZ_CR/ChaosRig/SK_KAMAZ_CR_ChaosRig_53605.SK_KAMAZ_CR_ChaosRig_53605'
mesh=unreal.load_object(None, mesh_path)
result={'ok': False, 'mesh': mesh_path}
if mesh:
skel=mesh.get_editor_property('skeleton')
names=[]
for i in range(skel.get_reference_pose().get_raw_bone_num()):
names.append(str(skel.get_reference_pose().get_bone_name(i)))
result['bones']=names
result['hasExpected']=all(n in names for n in ['Root','Body','Phys_Wheel_FL','Phys_Wheel_FR','Phys_Wheel_RL','Phys_Wheel_RR'])
result['physicsAsset']=str(mesh.get_editor_property('physics_asset'))
result['boundsOrigin']=str(mesh.get_bounds().origin)
result['boundsExtent']=str(mesh.get_bounds().box_extent)
result['ok']=result['hasExpected'] and 'PA_KAMAZ_CR_53605_Body' in result['physicsAsset']
os.makedirs(r'C:\Users\post\Documents\mrPlow\mrPlow58\VehicleExports\KAMAZ_CR', exist_ok=True)
with open(r'C:\Users\post\Documents\mrPlow\mrPlow58\VehicleExports\KAMAZ_CR\unreal_kamaz_cr_53605_gate_report.json','w',encoding='utf-8') as f:
json.dump(result,f,ensure_ascii=False,indent=2)
unreal.log('KAMAZ_CR gate: '+json.dumps(result,ensure_ascii=False))