Hey guys, I’m implementing a custom entity as a substructure for assets. Instead of asset type, I group assets by a custom entity that is called “asset_group”. All works fine. Folders are creating, files placed in a proper folder structure /assets/<asset_group>/…
But I have one problem. Shotgun toolkit actions are not showing in the right-click menu on the website if I’m on “Asset Group” page and clicking “asset group” entity. Shotgun starts to retrieve them but then everything disappears. I’ve added “asset_group.yml” file in the “tk-config/env” folder. And corrected “tk-config/core/hooks/pick_environment.py” file
class PickEnvironment(Hook):
def execute(self, context, **kwargs):
“”"
The default implementation assumes there are three environments, called shot, asset
and project, and switches to these based on entity type.
“”"
if context.source_entity:
if context.source_entity[“type”] == “Version”:
return “version”
elif context.source_entity[“type”] == “PublishedFile”:
return “publishedfile”if context.project is None: # Our context is completely empty. We're going into the site context. return "site" if context.entity is None: # We have a project but not an entity. return "project" print context.entity["type"] if context.entity and context.step is None: # We have an entity but no step. if context.entity["type"] == "Shot": return "shot" if context.entity["type"] == "Asset": return "asset" if context.entity["type"] == "Sequence": return "sequence" if context.entity["type"] == "CustomEntity01": return "asset_group" if context.entity and context.step: # We have a step and an entity. if context.entity["type"] == "Shot": return "shot_step" if context.entity["type"] == "Asset": return "asset_step" return None
Still no success. Need help. How to make it work on the platform side.