Accessing install_locaion.yml using Shotgrid API

Is there any way to access the install paths residing in config/core/install_location.yml using the Shotgrid API or sgtk?

import sgtk

# Get the current Toolkit Manager
mgr = sgtk.platform.current_bundle()

# Get the location of the current pipeline configuration
config_location = mgr.pipeline_configuration.get_path()

And then walk the directories and open the yaml file.

Hey @Ricardo_Musch. Going back to this, I am getting this error when trying to access the current_bundle from within a hook.

File “Z:\shgn\dev_sandbox\bos\install\core\python\tank\platform\”, line 57, in _get_current_bundle
"import_framework could not determine the calling module layout! "
tank.platform.errors.TankCurrentModuleNotFoundError: import_framework could not determine the calling module layout! You can only use this method on items imported using the import_module() method!

Could u assist?

Never mind, found it!


1 Like