Add a way to globally disable the cbId workflow in Maya

This commit is contained in:
Roy Nieterau 2024-03-25 20:22:07 +01:00
parent 1271b74f43
commit 4f60f2b21e
11 changed files with 80 additions and 0 deletions

View file

@ -32,6 +32,13 @@ class ValidateOutRelatedNodeIds(pyblish.api.InstancePlugin,
]
optional = False
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
"""Process all meshes"""
if not self.is_active(instance.data):

View file

@ -22,6 +22,13 @@ class ValidateArnoldSceneSourceCbid(pyblish.api.InstancePlugin,
actions = [RepairAction]
optional = False
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
@staticmethod
def _get_nodes_by_name(nodes):
nodes_by_name = {}

View file

@ -27,6 +27,13 @@ class ValidateLookIdReferenceEdits(pyblish.api.InstancePlugin):
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
RepairAction]
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
invalid = self.get_invalid(instance)

View file

@ -31,6 +31,13 @@ class ValidateNodeIDs(pyblish.api.InstancePlugin):
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
ayon_core.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
"""Process all meshes"""

View file

@ -26,6 +26,13 @@ class ValidateNodeIdsDeformedShape(pyblish.api.InstancePlugin):
RepairAction
]
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
"""Process all the nodes in the instance"""

View file

@ -26,6 +26,13 @@ class ValidateNodeIdsInDatabase(pyblish.api.InstancePlugin):
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
ayon_core.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
invalid = self.get_invalid(instance)
if invalid:

View file

@ -24,6 +24,13 @@ class ValidateNodeIDsRelated(pyblish.api.InstancePlugin,
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
ayon_core.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
"""Process all nodes in instance (including hierarchy)"""
if not self.is_active(instance.data):

View file

@ -26,6 +26,13 @@ class ValidateNodeIdsUnique(pyblish.api.InstancePlugin):
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
ayon_core.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
"""Process all meshes"""

View file

@ -34,6 +34,13 @@ class ValidateRigOutSetNodeIds(pyblish.api.InstancePlugin,
allow_history_only = False
optional = False
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
"""Process all meshes"""
if not self.is_active(instance.data):

View file

@ -32,6 +32,13 @@ class ValidateRigOutputIds(pyblish.api.InstancePlugin):
actions = [RepairAction,
ayon_core.hosts.maya.api.action.SelectInvalidAction]
@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if cbId workflow is disabled
if not project_settings["maya"].get("use_cbid_workflow", True):
cls.enabled = False
return
def process(self, instance):
invalid = self.get_invalid(instance, compute=True)
if invalid:

View file

@ -30,6 +30,15 @@ class ExtMappingItemModel(BaseSettingsModel):
class MayaSettings(BaseSettingsModel):
"""Maya Project Settings."""
use_cbid_workflow: bool = SettingsField(
True, title="Use cbId workflow",
description=(
"When enabled, a per node `cbId` identifier will be created and "
"validated for many product types. This is then used for look "
"publishing and many others. By disabling this, the `cbId` "
"attribute will still be created on scene save but it will not "
"be validated."))
open_workfile_post_initialization: bool = SettingsField(
True, title="Open Workfile Post Initialization")
explicit_plugins_loading: ExplicitPluginsLoadingModel = SettingsField(
@ -88,6 +97,7 @@ DEFAULT_MEL_WORKSPACE_SETTINGS = "\n".join((
))
DEFAULT_MAYA_SETTING = {
"use_cbid_workflow": True,
"open_workfile_post_initialization": True,
"explicit_plugins_loading": DEFAULT_EXPLITCIT_PLUGINS_LOADING_SETTINGS,
"imageio": DEFAULT_IMAGEIO_SETTINGS,