Files
Orbital_Inspection_VR/MyProject2/Saved/Config/ConsoleHistory.ini
T
2026-05-27 12:45:37 +03:00

6 lines
1.9 KiB
INI

[ConsoleHistory]
History=show bounds
History=py exec("import unreal\nfor a in unreal.EditorLevelLibrary.get_selected_level_actors():\n origin, extent = a.get_actor_bounds(False)\n sx, sy, sz = extent.x*2, extent.y*2, extent.z*2\n unreal.log(f'{a.get_actor_label()}: {sx:.2f} x {sy:.2f} x {sz:.2f} cm = {sx/100:.2f} x {sy/100:.2f} x {sz/100:.2f} m')")
History=py exec("import unreal\nactor_subsys = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)\nactors = actor_subsys.get_selected_level_actors()\nfor actor in actors:\n unreal.log('==============================')\n unreal.log(f'ACTOR: {actor.get_actor_label()}')\n comps = actor.get_components_by_class(unreal.StaticMeshComponent)\n if not comps:\n unreal.log(' No StaticMeshComponents found')\n for comp in comps:\n mesh = comp.get_editor_property('static_mesh')\n unreal.log('------------------------------')\n unreal.log(f' COMPONENT: {comp.get_name()}')\n if not mesh:\n unreal.log(' No mesh assigned')\n continue\n bbox = mesh.get_bounding_box()\n local_size = bbox.max - bbox.min\n scale = comp.get_component_transform().get_scale3d()\n placed_x = abs(local_size.x * scale.x)\n placed_y = abs(local_size.y * scale.y)\n placed_z = abs(local_size.z * scale.z)\n world_bounds = comp.bounds.box_extent * 2\n unreal.log(f' MESH ASSET: {mesh.get_name()}')\n unreal.log(f' Local mesh size: X={local_size.x:.2f}, Y={local_size.y:.2f}, Z={local_size.z:.2f} cm')\n unreal.log(f' Component scale: X={scale.x:.4f}, Y={scale.y:.4f}, Z={scale.z:.4f}')\n unreal.log(f' PLACED SIZE: X={placed_x:.2f}, Y={placed_y:.2f}, Z={placed_z:.2f} cm')\n unreal.log(f' PLACED SIZE: X={placed_x/100:.2f}, Y={placed_y/100:.2f}, Z={placed_z/100:.2f} m')\n unreal.log(f' World AABB bounds: X={world_bounds.x:.2f}, Y={world_bounds.y:.2f}, Z={world_bounds.z:.2f} cm')\n")