editor_get_world_outliner
Retrieve detailed data about all actors in a world, including properties and transform information, for efficient scene management in Unreal Engine.
Instructions
Get all actors in the current world with their properties
Example output: {'world_name': 'TestMap', 'total_actors': 45, 'actors': [{'name': 'StaticMeshActor_0', 'class': 'StaticMeshActor', 'location': {'x': 0.0, 'y': 0.0, 'z': 0.0}, 'rotation': {'pitch': 0.0, 'yaw': 0.0, 'roll': 0.0}, 'scale': {'x': 1.0, 'y': 1.0, 'z': 1.0}, 'is_hidden': false, 'folder_path': '/Meshes', 'components': ['StaticMeshComponent', 'SceneComponent']}]}
Returns complete world outliner with all actors and their transform data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The core handler function in Python that fetches all actors from the Unreal Editor world outliner, extracts their properties like name, class, location, rotation, scale, hidden status, folder path, and components, structures them into JSON, and returns the data.def get_world_outliner() -> Dict[str, Any]: world = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world() if not world: return {"error": "No world loaded"} # Get all actors in the current level all_actors = unreal.get_editor_subsystem( unreal.EditorActorSubsystem ).get_all_level_actors() outliner_data = { "world_name": world.get_name(), "total_actors": len(all_actors), "actors": [], } for actor in all_actors: try: actor_info = { "name": actor.get_name(), "class": actor.get_class().get_name(), "location": { "x": actor.get_actor_location().x, "y": actor.get_actor_location().y, "z": actor.get_actor_location().z, }, "rotation": { "pitch": actor.get_actor_rotation().pitch, "yaw": actor.get_actor_rotation().yaw, "roll": actor.get_actor_rotation().roll, }, "scale": { "x": actor.get_actor_scale3d().x, "y": actor.get_actor_scale3d().y, "z": actor.get_actor_scale3d().z, }, "is_hidden": actor.is_hidden_ed(), "folder_path": str(actor.get_folder_path()) if hasattr(actor, "get_folder_path") else None, } components = actor.get_components_by_class(unreal.ActorComponent) if components: actor_info["components"] = [ comp.get_class().get_name() for comp in components[:5] ] outliner_data["actors"].append(actor_info) except Exception as e: continue outliner_data["actors"].sort(key=lambda x: x["name"]) return outliner_data
- server/index.ts:299-314 (registration)Registers the 'editor_get_world_outliner' tool in the MCP server with an empty input schema and a handler that runs the Python script via editorTools.UEGetWorldOutliner().server.tool( "editor_get_world_outliner", "Get all actors in the current world with their properties\n\nExample output: {'world_name': 'TestMap', 'total_actors': 45, 'actors': [{'name': 'StaticMeshActor_0', 'class': 'StaticMeshActor', 'location': {'x': 0.0, 'y': 0.0, 'z': 0.0}, 'rotation': {'pitch': 0.0, 'yaw': 0.0, 'roll': 0.0}, 'scale': {'x': 1.0, 'y': 1.0, 'z': 1.0}, 'is_hidden': false, 'folder_path': '/Meshes', 'components': ['StaticMeshComponent', 'SceneComponent']}]}\n\nReturns complete world outliner with all actors and their transform data.", {}, async () => { const result = await tryRunCommand(editorTools.UEGetWorldOutliner()) return { content: [ { type: "text", text: result, }, ], } }, )
- server/editor/tools.ts:30-30 (helper)Helper function that reads and templates the Python script for the world outliner tool, preparing the code to be executed in the Unreal Editor.export const UEGetWorldOutliner = () => Template(read("./scripts/ue_get_world_outliner.py"))