I need add path to environment variable HOUDINI_PATH = tk-houdini-my_app.disk_location/houdini. I have custom *.idx presets which I want keep in my app, for this I need HOUDINI_PATH to presets location. How I can getting path to my bundle tk-houdini-my_app in hook hooks\tk-multi-launchapp\before_app_launch.py
Oh, I see now that you want to base this on the path to a custom app.
Not sure, the engine has not been initialized at this point, otherwise it is easy.
Maybe as Kemot says, you could pull it from the yaml somehow.
In the example above, I set paths relative to the pipeline configuration path (in a centralized config).
Of corse, I setup my app in app_locations.yaml. But app_locations have git paths. I need local path to my bundle_cache/git/tk-houdini-my_app. I don’t know how shotgun forms local paths using its api.
import sgtk
from sgtk.descriptor import Descriptor
sg = shotgun
uri = "sgtk:descriptor:app_store?name=tk-multi-workfiles2&version=v0.12.3" # app name and current version
descriptor_obj = sgtk.descriptor.create_descriptor(sg, Descriptor.CONFIG, uri)
path = descriptor_obj.get_path()
print(path)