Open douglaskastle opened 4 years ago
It's not needed to set the script directory in the preferences while running blender. It's possible to set the environment variable BLENDER_USER_SCRIPTS before starting blender. I do this in the script, that's firing up blender-addon-tester and it works fine, although it would be nice, if blender-addon-tester would take care of this.
I think i have figured out what was wrong, when you are installing you need to define the target, if you don't it just uses the default, use target='PREFS'
:
bpy.ops.preferences.addon_install(overwrite=True, filepath=zfile.as_posix())
versus:
bpy.ops.preferences.addon_install(overwrite=True, target='PREFS', filepath=zfile.as_posix())
A feature was added to change the location of the addon installation.
bpy.context.user_preferences.filepaths.script_directory = addon_dir
turns out this value does not take effect until there is a restart. I can not find a command to restart blender, so while this value does change successfully, it no effect on testing.
https://docs.blender.org/api/current/bpy.types.PreferencesFilePaths.html#bpy.types.PreferencesFilePaths.script_directory