fabex.utilities.addon_utils#

Fabex ‘addon_utils.py’ © 2012 Vilem Novak

Functions#

addon_dependencies()

Checks for and installs Blender addon dependencies.

load_defaults(addon_prefs)

Assigns scene settings based on user preferences.

copy_if_not_exists(src, dst)

Copy a file from source to destination if it does not already exist.

copy_presets(addon_prefs)

Copies Presets from the addon to Blender's Script Directory

on_blender_startup(context)

Checks for any broken computations on load and resets them.

on_engine_change(*args)

Callback function to setup Fabex when activated.

fix_units()

Set up units for Fabex.

keymap_register()

keymap_unregister()

add_asset_library()

Installs the Fabex Asset Library.

add_workspace()

Installs the Fabex Workspace

add_collections()

Adds color-coded Collection folders to the scene.

Module Contents#

addon_dependencies()[source]#

Checks for and installs Blender addon dependencies.

This function installs a number of addons that previously came with Blender, but now have to be downloaded from an online repository. It checks for the addon in the users Blender install, and if it can’t find them, attempts to download them from Blender.

load_defaults(addon_prefs)[source]#

Assigns scene settings based on user preferences.

When Fabex is activated it will restore the user’s scene settings. This includes the interface level (Beginner - Experimental), viewport shading, panel layout and machine preset.

copy_if_not_exists(src, dst)[source]#

Copy a file from source to destination if it does not already exist.

This function checks if the destination file exists. If it does not, the function copies the source file to the destination using a high-level file operation that preserves metadata.

Parameters:
  • src (str) – The path to the source file to be copied.

  • dst (str) – The path to the destination where the file should be copied.

copy_presets(addon_prefs)[source]#

Copies Presets from the addon to Blender’s Script Directory

This function copies new presets without overwriting the existing presets, unless it detects that the presets have not been updated to the current spec, in which case it will overwrite them with the addon presets.

on_blender_startup(context)[source]#

Checks for any broken computations on load and resets them.

This function verifies the presence of necessary Blender add-ons and installs any that are missing. It also resets any ongoing computations in CAM operations and sets the interface level to the previously used level when loading a new file. If the add-on has been updated, it copies the necessary presets from the source to the target directory. Additionally, it checks for updates to the CAM plugin and updates operation presets if required.

Parameters:

context – The context in which the function is executed, typically containing information about the current Blender environment.

on_engine_change(*args)[source]#

Callback function to setup Fabex when activated.

In combination with a message bus (msgbus) listener, this function will run when the Render Engine is changed. If it detects that Fabex is active it will call the required setup functions, and log the Fabex activation.

fix_units()[source]#

Set up units for Fabex.

This function configures the unit settings for the current Blender scene. It sets the rotation system to degrees and the scale length to 1.0, ensuring that the units are appropriately configured for use within Fabex.

keymap_register()[source]#
keymap_unregister()[source]#
add_asset_library()[source]#

Installs the Fabex Asset Library.

This function adds the /assets/ folder from Fabex to the users’ Asset Library, which adds a number of Material and Geometry Node assets.

add_workspace()[source]#

Installs the Fabex Workspace

This function adds the Fabex Workspace to the users’ default Blender startup scene.

add_collections()[source]#

Adds color-coded Collection folders to the scene.

This function adds three collections to aid in scene management. Bridges, Paths and Simulations are now auto-sorted into their own collections upon creation, which can be shown or hidden as groups.