I’m creating a server addon for the first time and I’m running into a wall. I want to get the project settings of another addon than the one I’m developing. I’m not sure how to approach this. When you call self.get_studio_settings you only get the settings for the current addon but I want to query the settings for the core addon
Should I make a custom postgres call? I’m quite new to that.
Hope someone can point me in the right direction.
Thanks!
Ralph
There is no easy answer to your question. It is needed to know full context of what are you doing and where you want to access core addon settings.
To get settings of other addon you can use AddonLibrary but you have to know which version of the addon you want to get, and what settings variant you want to get (“production”, “staging” or any of develop bundles).
This practically means that you can get settings of other addon in specific cases like actions or custom endpoints, where you can get information about variant, with variant you can find bundle that is used for the settings variant from which you can get which version is used. But if you want to get other addon settings to e.g. use them in your settings then it is semi-possible, but you have know how the server backend works which is beyond short answer on forum (at least for me) still will have some caviads.
from ayon_server.addons.library import AddonLibrary
addon_name = "..."
addon_version = "..."
variant = "..."
addon = AddonLibrary.addon(
addon_name,
addon_version,
)
settings_model = await addon.get_studio_settings(variant)
...
Could you elaborate more?
Does this other addon belong to the current bundle (the selected bundle when starting AYON launcher) or another bundle or even not in a bundle?
Usually for testing I get current bundle settings as in ayon-recipes/get_bundle_settings_addons_info.py at be89caad3cf7748d6531d74ea1acb9975b644d40 · MustafaJafar/ayon-recipes · GitHub