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

Remove link to addon directory at exit of blender - take 2 #2 #183

Closed

Conversation

Mateusz-Grzelinski
Copy link
Collaborator

Work and design still in progress.

This PR fixes issues that pop up in ugly corner cases in various places:

  • uninstalling addon from blender might lead to data loss
  • importing data from previous blender converts junction (link) into directory what leads to permission error when trying to install addon

Design 1 - link only when debugging - implemented in this PR

  • temporary link to addon dir is made only for VS code session - proposed in Remove link to addon directory at exit of blender #55 but not merged, so
    • add new setting to go back to previous behaviour - simple
    • or create a command "Blender: Install addons" that links/installs addons permamently - might be complicated - addons can have different ways of installation.

Design 2 - modify addon directory

  • modify VS code startup to use separate addon BLENDER_USER_SCRIPTS and dir BLENDER_SYSTEM_EXTENSIONS
    • need to be carefull to prioritize directory that user sets

In this PR implemented:

  • Done: Disable "Load Previous settings" blender feature during VS code session.
  • Done: send notification if linking addon failed
  • Done: make addon link/junction temporary
    • add setting to fallback to old behaviour blender.addon.keepAddonInstalled
  • todo: fix tests
  • maybe: clean blender errors which say: "Missing addons"
  • windows only: block addon uninstallation - on windows it causes data loss, on linux/mac soft links are handled correctly from blender 2.8 (source)
    image
  • windows only: block removal of extension repo as it might lead to data loss
    image
  • automatically apply obvious blender defaults

Because of many changes, this PR waits for #172 to complete.

Relevant: #49

- Capitalize global variables
- Add type hints
Fresh installation of blender is not going to have directory created.
…o-cherry-pick

# Conflicts:
#	pythonFiles/include/blender_vscode/__init__.py
#	pythonFiles/include/blender_vscode/load_addons.py
- you are developing extension in addons directory
- extension has legacy bl_info defined
- do not create a link
- prevent from various errors from old links
- during blender version upgrade links are copied what breaks them and required manual fix
* cleanup old links in limited way
* search for duplicate links already present on file system
Small changes to types
@Mateusz-Grzelinski
Copy link
Collaborator Author

wrong base branch, sory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant