How to add multiple plugins and not items on Publish

Hi All,

So, I’ve been trying to create a single item to export my assets with different options, but I only get items and not plugins/options. For example:

[MY ASSET]
- Export Asset
[MY ASSET]
- Export Textures
[MY ASSET]
- …

I know to create items, but I don’t know how can I convert the item created to the plugin. I tried to put the second item created parented on the item but a sub-item was created. I would like to create different plugins linked to the item/asset.

I know how to create different items, but I am unsure how to convert them to plugins. When I try to parent it to the item, a sub-item is created instead. I aim to create various plugins that are linked to the item or asset.

The idea is:

[Item]
- Export Asset
- Export Textures
- Export to Unreal

I’m unsure about the best way to create an item with different plugins parented.
Anyone could help me. I am sharing a part of my code.

Note: Ignore the name of my vars. It is only a separate code to exemplify my issue. Sorry

I really appreciate any help you can provide.
Thanks in advance
Ricardo



Hi Ricardo.

In order to have several plugins in one item you need to have the same filter string for several of them.
For example, now you have two filters: ItemSessionLoader and ItemSessionExport. And creating two items: AssetGEORIGGroup_item_loader and AssetGEORIGGroup_item_export.
Just try to use one filter and one item instead.

AssetGEORIGGroup_item = parent_item.create_item(
    "maya.session.exports",
    "various exports for asset",
    "Exports"
)

Then in your plugins use also the same filter.

class MyExportTextures(HookBaseClass):
    @property
    def item_filters(self):
        """
        List of item types that this plugin is interested in.
        """
        return ["maya.session.exports"]

class MyExportMesh(HookBaseClass):
    @property
    def item_filters(self):
        """
        List of item types that this plugin is interested in.
        """
        return ["maya.session.exports"]

That way you should get this as a result:

1 Like

The solution was perfect.
Thanks a million, @grover_gol

1 Like