I’ve got a custom framework which is a python library of convenience functions for our studio.
Ideally I would love to load this (add the library to the sys.path) when shotgun desktop loads up a project so the library files are available for import in anything launched from that SG desktop session.
However I currently don’t seem to get the framework loaded.
This is how I’ve got it setup:
tk-desktop.yml
# project
settings.tk-desktop.project:
frameworks:
- {"name": "lp-tk-framework-custom", "version": "v0.0.0"}
apps:
tk-multi-pythonconsole:
location: "@apps.tk-multi-pythonconsole.location"
tk-multi-devutils:
location: "@apps.tk-multi-devutils.location"
tk-multi-launchapp: "@settings.tk-multi-launchapp"
frameworks.yml
lp-tk-framework-custom:
location:
version: v0.0.0
type: dev
path: F:\some_path\lp-tk-framework-custom
framework.yml (inside the framework folder)
class CustomFramework(sgtk.platform.Framework):
def init_framework(self):
"""
Init this framework.
"""
path = os.path.join(os.path.dirname(__file__), "python")
sys.path.insert(0, path)
- Ignore the weird formatting above, the code doesn’t always copy nicely into the forum editor!