I have created a custom creator for maya it is working when I create for first time but is it causing issue after refresh, for the first time it is showing a toggle button for my custom creator but after that toggle button disappears adding screenshot for reference, in the 1st screenshot there is toggle for “rig Assembly” but after refresh it is missing
class CreateRigAssembly(plugin.MayaCreator):
identifier = "{your studio}.rig.assembly"
product_base_type = "rig"
product_type = product_base_type
maintain_selection = True
# The 'get_default_variants' should not use 'get_project_settings'
# you can override 'apply_settings' method to store settings values
# to use them. In this case, if you follow correct structure of settings
# then all you have to do is to define settings_category to
# auto-apply settings -> change 'defautt_variants'
settings_category = "{your addon name}"
def get_publish_families(self):
# 'MayaCreator' Does override 'families' in collection phase
# is using 'get_publish_families' as source
return ["rig_assembly"]
def get_product_type_items(self) -> list[ProductTypeItem]:
# If you want to customize product type use this
# 'product_type' attribute is deprecated variant of 'product_base_type'
# and will be removed in future releases.
return [ProductTypeItem("rig_puppet")]
def create(self, product_name, instance_data, pre_create_data):
import maya.cmds as cmds
selection = cmds.ls(sl=True) or []
# You don't need to store 'product_type' it is stored as 'productType'
# key 'families' is handled by 'get_publish_families'
instance_data["members"] = selection
instance = super().create(
product_name, instance_data, pre_create_data
)