blendersynth.run.import_handling

For calling errors if a user tries run certain operations in the wrong python environment

class blendersynth.run.import_handling.IllegalImport(REQUIRES_BLENDER=True)[source]

Object which raises error on any interaction, to tell users they have used BlenderSynth incorrectly.

blendersynth.run.import_handling.conditional_import(condition, src, name=None)[source]

[No longer used in __init__.py, but kept here for reference] Imports a module if condition, otherwise returns IllegalImport.

Parameters:
  • condition (bool) – If True, import the module

  • src (str) – The module to import

  • name (str) – The name of the module to import. If None, the last part of src is used.

Return type:

Union[IllegalImport, object]

Returns:

The imported module, or IllegalImport if condition is False