mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge pull request #242 from BigRoy/enhancement/maya_disable_cbid_workflow
Maya: Add setting to disable `cbId` workflow
This commit is contained in:
commit
573e29ac5c
12 changed files with 101 additions and 3 deletions
|
|
@ -7,7 +7,9 @@ from ayon_core.pipeline.publish import (
|
||||||
RepairAction,
|
RepairAction,
|
||||||
ValidateContentsOrder,
|
ValidateContentsOrder,
|
||||||
PublishValidationError,
|
PublishValidationError,
|
||||||
OptionalPyblishPluginMixin
|
OptionalPyblishPluginMixin,
|
||||||
|
get_plugin_settings,
|
||||||
|
apply_plugin_settings_automatically
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -32,6 +34,20 @@ class ValidateOutRelatedNodeIds(pyblish.api.InstancePlugin,
|
||||||
]
|
]
|
||||||
optional = False
|
optional = False
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def apply_settings(cls, project_settings):
|
||||||
|
# Preserve automatic settings applying logic
|
||||||
|
settings = get_plugin_settings(plugin=cls,
|
||||||
|
project_settings=project_settings,
|
||||||
|
log=cls.log,
|
||||||
|
category="maya")
|
||||||
|
apply_plugin_settings_automatically(cls, settings, logger=cls.log)
|
||||||
|
|
||||||
|
# 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):
|
def process(self, instance):
|
||||||
"""Process all meshes"""
|
"""Process all meshes"""
|
||||||
if not self.is_active(instance.data):
|
if not self.is_active(instance.data):
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,13 @@ class ValidateArnoldSceneSourceCbid(pyblish.api.InstancePlugin,
|
||||||
actions = [RepairAction]
|
actions = [RepairAction]
|
||||||
optional = 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
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_nodes_by_name(nodes):
|
def _get_nodes_by_name(nodes):
|
||||||
nodes_by_name = {}
|
nodes_by_name = {}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,13 @@ class ValidateLookIdReferenceEdits(pyblish.api.InstancePlugin):
|
||||||
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
||||||
RepairAction]
|
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):
|
def process(self, instance):
|
||||||
invalid = self.get_invalid(instance)
|
invalid = self.get_invalid(instance)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,13 @@ class ValidateNodeIDs(pyblish.api.InstancePlugin):
|
||||||
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
||||||
ayon_core.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
|
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):
|
def process(self, instance):
|
||||||
"""Process all meshes"""
|
"""Process all meshes"""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,13 @@ class ValidateNodeIdsDeformedShape(pyblish.api.InstancePlugin):
|
||||||
RepairAction
|
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):
|
def process(self, instance):
|
||||||
"""Process all the nodes in the instance"""
|
"""Process all the nodes in the instance"""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,13 @@ class ValidateNodeIdsInDatabase(pyblish.api.InstancePlugin):
|
||||||
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
||||||
ayon_core.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
|
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):
|
def process(self, instance):
|
||||||
invalid = self.get_invalid(instance)
|
invalid = self.get_invalid(instance)
|
||||||
if invalid:
|
if invalid:
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,13 @@ class ValidateNodeIDsRelated(pyblish.api.InstancePlugin,
|
||||||
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
||||||
ayon_core.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
|
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):
|
def process(self, instance):
|
||||||
"""Process all nodes in instance (including hierarchy)"""
|
"""Process all nodes in instance (including hierarchy)"""
|
||||||
if not self.is_active(instance.data):
|
if not self.is_active(instance.data):
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,13 @@ class ValidateNodeIdsUnique(pyblish.api.InstancePlugin):
|
||||||
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction,
|
||||||
ayon_core.hosts.maya.api.action.GenerateUUIDsOnInvalidAction]
|
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):
|
def process(self, instance):
|
||||||
"""Process all meshes"""
|
"""Process all meshes"""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,9 @@ from ayon_core.pipeline.publish import (
|
||||||
RepairAction,
|
RepairAction,
|
||||||
ValidateContentsOrder,
|
ValidateContentsOrder,
|
||||||
PublishValidationError,
|
PublishValidationError,
|
||||||
OptionalPyblishPluginMixin
|
OptionalPyblishPluginMixin,
|
||||||
|
get_plugin_settings,
|
||||||
|
apply_plugin_settings_automatically
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -34,6 +36,20 @@ class ValidateRigOutSetNodeIds(pyblish.api.InstancePlugin,
|
||||||
allow_history_only = False
|
allow_history_only = False
|
||||||
optional = False
|
optional = False
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def apply_settings(cls, project_settings):
|
||||||
|
# Preserve automatic settings applying logic
|
||||||
|
settings = get_plugin_settings(plugin=cls,
|
||||||
|
project_settings=project_settings,
|
||||||
|
log=cls.log,
|
||||||
|
category="maya")
|
||||||
|
apply_plugin_settings_automatically(cls, settings, logger=cls.log)
|
||||||
|
|
||||||
|
# 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):
|
def process(self, instance):
|
||||||
"""Process all meshes"""
|
"""Process all meshes"""
|
||||||
if not self.is_active(instance.data):
|
if not self.is_active(instance.data):
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,13 @@ class ValidateRigOutputIds(pyblish.api.InstancePlugin):
|
||||||
actions = [RepairAction,
|
actions = [RepairAction,
|
||||||
ayon_core.hosts.maya.api.action.SelectInvalidAction]
|
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):
|
def process(self, instance):
|
||||||
invalid = self.get_invalid(instance, compute=True)
|
invalid = self.get_invalid(instance, compute=True)
|
||||||
if invalid:
|
if invalid:
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,15 @@ class ExtMappingItemModel(BaseSettingsModel):
|
||||||
class MayaSettings(BaseSettingsModel):
|
class MayaSettings(BaseSettingsModel):
|
||||||
"""Maya Project Settings."""
|
"""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(
|
open_workfile_post_initialization: bool = SettingsField(
|
||||||
True, title="Open Workfile Post Initialization")
|
True, title="Open Workfile Post Initialization")
|
||||||
explicit_plugins_loading: ExplicitPluginsLoadingModel = SettingsField(
|
explicit_plugins_loading: ExplicitPluginsLoadingModel = SettingsField(
|
||||||
|
|
@ -88,6 +97,7 @@ DEFAULT_MEL_WORKSPACE_SETTINGS = "\n".join((
|
||||||
))
|
))
|
||||||
|
|
||||||
DEFAULT_MAYA_SETTING = {
|
DEFAULT_MAYA_SETTING = {
|
||||||
|
"use_cbid_workflow": True,
|
||||||
"open_workfile_post_initialization": True,
|
"open_workfile_post_initialization": True,
|
||||||
"explicit_plugins_loading": DEFAULT_EXPLITCIT_PLUGINS_LOADING_SETTINGS,
|
"explicit_plugins_loading": DEFAULT_EXPLITCIT_PLUGINS_LOADING_SETTINGS,
|
||||||
"imageio": DEFAULT_IMAGEIO_SETTINGS,
|
"imageio": DEFAULT_IMAGEIO_SETTINGS,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""Package declaring addon version."""
|
"""Package declaring addon version."""
|
||||||
__version__ = "0.1.10"
|
__version__ = "0.1.11"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue