# CustomEntity envoronment

**URL:** <https://community.shotgridsoftware.com/t/customentity-envoronment/12128>\
**Category:** Pipeline Integrations\
**Tags:** fptr-tk\
**Created:** [April 14, 2021, 3:54pm UTC](https://community.shotgridsoftware.com/t/customentity-envoronment/12128 "2021-04-14T15:54:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![grover\_gol](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/grover_gol/32/2436_2.png) [@grover\_gol](https://community.shotgridsoftware.com/u/grover_gol)\
**Post date:** [April 14, 2021, 3:54pm UTC](https://community.shotgridsoftware.com/t/customentity-envoronment/12128/1 "2021-04-14T15:54:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jaredauty](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/jaredauty/32/2364_2.png) [@jaredauty](https://community.shotgridsoftware.com/u/jaredauty)\
**Post date:** [April 28, 2021, 6:56am UTC](https://community.shotgridsoftware.com/t/customentity-envoronment/12128/2 "2021-04-28T06:56:50Z")

</div>

I think the menu items in shotgun Web are driven by the tk-shotgun engine so likely you’d need to make sure there are apps set up for that engine in your new environment.

---

<div class="post-metadata">

**Author:** ![Ehsan](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/ehsan/32/2404_2.png) [@Ehsan](https://community.shotgridsoftware.com/u/Ehsan)\
**Post date:** [April 30, 2021, 4:30pm UTC](https://community.shotgridsoftware.com/t/customentity-envoronment/12128/3 "2021-04-30T16:30:11Z")

</div>

Hi @grover_gol,

I think your issue might be coming from the fact that the desktopserver has an allow list of entities that it will process. The list is something like “Sequence”, “Task”, “Version”, and any entity that can be published to.

I’m hoping you can use that last bit to resolve your issue. If you go to your custom entity in your SG `Site Preferences` you should be able to turn on publishing on your entity.

 ![custom_entity_publish_option](https://global.discourse-cdn.com/shotgunsoftware/original/2X/7/73e8ae2c9984f45d7bd65fb45685e1c3b4697fd9.jpeg)

I think this will allow you to add actions to the entity.

---

<div class="post-metadata">

**Author:** ![grover\_gol](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/grover_gol/32/2436_2.png) [@grover\_gol](https://community.shotgridsoftware.com/u/grover_gol)\
**Post date:** [May 7, 2021, 8:27pm UTC](https://community.shotgridsoftware.com/t/customentity-envoronment/12128/4 "2021-05-07T20:27:18Z")

</div>

Thanks guys I’ve figured it out. All works now.
