apply_python_to_selection
Execute Python scripts on the currently selected actors and assets in the Unreal Engine editor. Automatically injects selection variables for direct use.
Instructions
Run user Python with the editor's current selection pre-bound: selection (selected level actors) and selected_assets (selected content-browser assets). Convenience wrapper around execute_unreal_python that injects the lookup boilerplate. Same output-capture caveat: ExecuteFile mode does not return stdout; use unreal.log marker + get_log_lines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source. The injected boilerplate makes `selection` (list of AActor) and `selected_assets` (list of UObject) available -- use either name directly. |