editor_get_world_outliner
Retrieve all actors in the current Unreal Engine world with their properties and transform data for scene analysis and management.
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 Python script implementing the core logic for retrieving the world outliner data using Unreal Engine's Python API. The `get_world_outliner()` function collects actor details including name, class, transform (location, rotation, scale), visibility, folder path, and components.from typing import Dict, Any import unreal import json 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 def main(): outliner_data = get_world_outliner() print(json.dumps(outliner_data, indent=2)) if __name__ == "__main__": main()
- server/index.ts:299-314 (registration)MCP tool registration for 'editor_get_world_outliner'. Defines no input schema, a detailed description, and a handler that executes the tool via `tryRunCommand(editorTools.UEGetWorldOutliner())` and returns the result as text content.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 ue_get_world_outliner.py script content for execution by the MCP tool handler.export const UEGetWorldOutliner = () => Template(read("./scripts/ue_get_world_outliner.py"))