unreal_engine_tools¶
unreal_engine_tools.py collects helpers that the rest of Starcel uses. Import what you need:
Finding things¶
| Function | Returns |
|---|---|
get_world() |
The game world (cached) |
find_actor(name, fuzzy=True) |
One actor by name. If there's no exact match, the first whose name contains name. |
find_actors(name, fuzzy=True) |
All matching actors |
find_component(actor, name) |
A component of an actor by name |
print_all_actors() |
Prints every actor's name |
world = get_world()
pc = world.get_player_controller(0)
sky = find_actor('BP_SkySphere')
sky.SetActorHiddenInGame(True)
Folders¶
| Function | Returns |
|---|---|
get_content_folder() |
.../Starcel9/Content |
get_scripts_folder() |
.../Starcel9/Content/Scripts |
get_python_root() |
The Python installation |
Materials and textures¶
from unreal_engine_tools import apply_material, load_texture_any
apply_material(
actor=find_actor('MyCube'),
component_name='StaticMeshComponent0',
material_path='/Game/Materials/M_Color.M_Color',
params={'Color': (1, 0, 0)},
)
tex = load_texture_any('C:/pictures/cat.png') # any image file -> Texture2D
params sets material parameters by type: numbers, colours, image paths ('Texture': 'C:/sky.png') or TextureCube assets.
pil_image_to_texture(img) turns a Pillow image into a texture. load_blueprint_class(path) loads a Blueprint's class in the editor and in packaged builds.
Background and window¶
| Function | Does |
|---|---|
change_background(name, path=...) |
See Backgrounds |
rotate_background() |
Next background |
toggle_window_transparency() |
Transparent window on or off |
fullscreen(), windowed(), windowed_fullscreen() |
Window mode |
embed_as_desktop_background() |
Run Starcel as your desktop wallpaper |
restore_from_desktop_background() |
Back to a normal window |
How To Use Starcel as a Custom Windows Wallpaper¶
Other¶
| Function | Does |
|---|---|
rebuild_generated_modules() |
Regenerates the autocomplete stubs, CLI, cell stubs and key binding docs |
invalidate_world_cache() |
Forget the cached world and actors (after changing maps) |
No test yet
The examples on this page are written by hand: no test covers it yet. See Tests as examples.