file_utils

Locating and loading the image assets a scene refers to by name.

Every user-facing path argument – ImageMob, set_background(), set_environment_map() and the 3-D model loaders – routes through resolve_asset_path(), so a file sitting beside the running script loads regardless of the working directory.

Functions

get_image(file_path)[source]
resolve_asset_path(file_path)[source]

Return a usable path for an image the user referred to by name.

A relative path is tried against the working directory first, then against the directory of the script being run. Without that second lookup, ImageMob('world_map.jpg') only finds an image sitting next to your script when you happen to launch Python from that same directory.

An unresolvable path is returned unchanged so the loader still reports the name the user actually wrote.