Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing addon install directory does not work #26

Open
douglaskastle opened this issue Apr 15, 2020 · 2 comments
Open

Changing addon install directory does not work #26

douglaskastle opened this issue Apr 15, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@douglaskastle
Copy link
Member

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

@douglaskastle douglaskastle added the bug Something isn't working label Apr 15, 2020
@FrankFirsching
Copy link

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.

@douglaskastle
Copy link
Member Author

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())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants