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

BLENDER_USER_SCRIPTS overrides local user scripts #7

Open
danbradham opened this issue Jun 11, 2021 · 0 comments
Open

BLENDER_USER_SCRIPTS overrides local user scripts #7

danbradham opened this issue Jun 11, 2021 · 0 comments

Comments

@danbradham
Copy link

Hi thank you for creating tk-blender. I've set it up in our pipeline and run into a bit of an issue.

Describe the bug
By setting BLENDER_USER_SCRIPTS to the tk-blender/scripts directory tk-blender essentially disables the default site for user addons and modules. I feel like this is problematic because it makes it difficult to share and install addons in a pipeline without shipping a custom tk-blender that embeds the addons.

To Reproduce
Steps to reproduce the behavior:

  1. Put an addon in C:\Users<User>\AppData\Roaming\Blender Foundation\Blender<Version>\scripts\addons
  2. Launch Blender through Shotgun Toolkit
  3. Addon is unavailable in Blender.

Expected behavior
Addons installed to the standard user scripts directory should be available when launching through Shotgun Toolkit.

Possible Solution
It may make more sense to copy the shotgun_menu.py module into the existing user scripts startup for the current user. This way it doesn't conflict with a studio's existing pipeline or a users customized scripts folder.

This might be somewhat trivial like:

  1. check if BLENDER_USER_SCRIPTS is set
  2. If set: copy shotgun_menu.py to BLENDER_USER_SCRIPTS/startup
  3. If not set: copy shotgun_menu.py to default BLENDER_USER_SCRIPTS/startup

The default locations can be found here https://docs.blender.org/manual/en/latest/advanced/blender_directory_layout.html

If this route was chosen, a small bit of logic would need to be added to the shotgun_menu.register to return quickly if Blender was not launched via Shotgun i.e. there is no SGTK_* environment variable.

danbradham added a commit to danbradham/tk-blender that referenced this issue Jun 15, 2021
…u.py to a users

existing scripts directory.
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

No branches or pull requests

1 participant