blendersynth.utils.blender_setup.blender_locator

blendersynth.utils.blender_setup.blender_locator.find_blender_python(blender_path)[source]

Given a blender executable, find the python interpreter it uses

Parameters:

blender_path (str) – path to blender executable

Return type:

str

blendersynth.utils.blender_setup.blender_locator.get_blender_path()[source]

Return blender path, or None if no config file found

Return type:

str

blendersynth.utils.blender_setup.blender_locator.is_blender_in_path()[source]

Check if blender is in the PATH (i.e. can be run from the command line with ‘blender’)

Return type:

bool

blendersynth.utils.blender_setup.blender_locator.read_from_config(key, section='BLENDER_SETUP')[source]

Load config, and read value from cfg[section]

blendersynth.utils.blender_setup.blender_locator.remove_config()[source]

Remove config file

blendersynth.utils.blender_setup.blender_locator.remove_from_config(key, section='BLENDER_SETUP')[source]

Load config, and remove key from cfg[section]

blendersynth.utils.blender_setup.blender_locator.set_blender_path(_blender_path=None)[source]

First time set-up of Blender Path. Will try to find Blender path in following order of precedence: :rtype: str

  1. Input argument _blender_path

  2. Environment variable BLENDER_PATH

  3. Blender in PATH

  4. Ask user for path

When it finds a valid path, it will save it to the Config file stored in user’s platformdirs.user_config_dir

blendersynth.utils.blender_setup.blender_locator.validate_blender_path(blender_path)[source]

Check if blender_path is a valid blender executable.

Parameters:

blender_path (str) – path to blender executable

Return type:

bool

blendersynth.utils.blender_setup.blender_locator.write_to_config(key, value, section='BLENDER_SETUP')[source]

Load config, and write key value pair to cfg[section]