Utilities (bpy.utils)

This module contains utility functions specific to blender but not assosiated with blenders internal data.

bpy.utils.blend_paths(absolute=False)

Returns a list of paths to external files referenced by the loaded .blend file.

Parameters:
  • absolute (boolean) – When true the paths returned are made absolute.
Returns:

path list.

Return type:

list of strigs

bpy.utils.load_scripts(reload_scripts=False, refresh_scripts=False)

Load scripts and run each modules register function.

Parameters:
  • reload_scripts (bool) – Causes all scripts to have their unregister method called before loading.
  • refresh_scripts (bool) – only load scripts which are not already loaded as modules.
bpy.utils.modules_from_path(path, loaded_modules)

Load all modules in a path and return them as a list.

Parameters:
  • path (string) – this path is scanned for scripts and packages.
  • loaded_modules (set) – already loaded module names, files matching these names will be ignored.
Returns:

all loaded modules.

Return type:

list

bpy.utils.preset_paths(subdir)

Returns a list of paths for a specific preset.

bpy.utils.script_paths(subdir=None, user=True)

Returns a list of valid script paths from the home directory and user preferences.

Accepts any number of string arguments which are joined to make a path.

bpy.utils.smpte_from_frame(frame, fps=None, fps_base=None)

Returns an SMPTE formatted string from the frame: “HH:MM:SS:FF”.

If the fps and fps_base are not given the current scene is used.

bpy.utils.smpte_from_seconds(time, fps=None)

Returns an SMPTE formatted string from the time in seconds: “HH:MM:SS:FF”.

If the fps is not given the current scene is used.

bpy.utils.user_script_path()

Previous topic

bpy_struct

Next topic

Path Utilities (bpy.path)