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:
Put an addon in C:\Users\\AppData\Roaming\Blender Foundation\Blender\\scripts\addons
Launch Blender through Shotgun Toolkit
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:
check if BLENDER_USER_SCRIPTS is set
If set: copy shotgun_menu.py to BLENDER_USER_SCRIPTS/startup
If not set: copy shotgun_menu.py to default BLENDER_USER_SCRIPTS/startup
If this route was chosen, a small bit of logic would need to be added to the shotgunmenu.register to return quickly if Blender was not launched via Shotgun i.e. there is no SGTK* environment variable.
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:
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:
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 shotgunmenu.register to return quickly if Blender was not launched via Shotgun i.e. there is no SGTK* environment variable.