mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #474 from ynput/enhancement/AY-1001_validate-render-settings-optional
Maya: make render settings validator optional
This commit is contained in:
commit
f6df3d104d
2 changed files with 17 additions and 7 deletions
|
|
@ -10,6 +10,7 @@ from ayon_core.pipeline.publish import (
|
|||
RepairAction,
|
||||
ValidateContentsOrder,
|
||||
PublishValidationError,
|
||||
OptionalPyblishPluginMixin
|
||||
)
|
||||
from ayon_core.hosts.maya.api import lib
|
||||
from ayon_core.hosts.maya.api.lib_rendersettings import RenderSettings
|
||||
|
|
@ -37,7 +38,8 @@ def get_redshift_image_format_labels():
|
|||
return mel.eval("{0}={0}".format(var))
|
||||
|
||||
|
||||
class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
||||
class ValidateRenderSettings(pyblish.api.InstancePlugin,
|
||||
OptionalPyblishPluginMixin):
|
||||
"""Validates the global render settings
|
||||
|
||||
* File Name Prefix must start with: `<Scene>`
|
||||
|
|
@ -55,7 +57,7 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
|||
* Frame Padding must be:
|
||||
* default: 4
|
||||
|
||||
* Animation must be toggle on, in Render Settings - Common tab:
|
||||
* Animation must be toggled on, in Render Settings - Common tab:
|
||||
* vray: Animation on standard of specific
|
||||
* arnold: Frame / Animation ext: Any choice without "(Single Frame)"
|
||||
* redshift: Animation toggled on
|
||||
|
|
@ -67,10 +69,11 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
|||
"""
|
||||
|
||||
order = ValidateContentsOrder
|
||||
label = "Render Settings"
|
||||
label = "Validate Render Settings"
|
||||
hosts = ["maya"]
|
||||
families = ["renderlayer"]
|
||||
actions = [RepairAction]
|
||||
optional = True
|
||||
|
||||
ImagePrefixes = {
|
||||
'mentalray': 'defaultRenderGlobals.imageFilePrefix',
|
||||
|
|
@ -112,6 +115,8 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
|||
DEFAULT_PREFIX = "<Scene>/<RenderLayer>/<RenderLayer>_<RenderPass>"
|
||||
|
||||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ class ValidateAttributesModel(BaseSettingsModel):
|
|||
|
||||
if not success:
|
||||
raise BadRequestException(
|
||||
"The attibutes can't be parsed as json object"
|
||||
"The attributes can't be parsed as json object"
|
||||
)
|
||||
return value
|
||||
|
||||
|
|
@ -265,7 +265,7 @@ class ValidateUnrealStaticMeshNameModel(BaseSettingsModel):
|
|||
enabled: bool = SettingsField(title="ValidateUnrealStaticMeshName")
|
||||
optional: bool = SettingsField(title="Optional")
|
||||
validate_mesh: bool = SettingsField(title="Validate mesh names")
|
||||
validate_collision: bool = SettingsField(title="Validate collison names")
|
||||
validate_collision: bool = SettingsField(title="Validate collision names")
|
||||
|
||||
|
||||
class ValidateCycleErrorModel(BaseSettingsModel):
|
||||
|
|
@ -288,7 +288,7 @@ class ValidatePluginPathAttributesModel(BaseSettingsModel):
|
|||
and the node attribute is <b>abc_file</b>
|
||||
"""
|
||||
|
||||
enabled: bool = True
|
||||
enabled: bool = SettingsField(title="Enabled")
|
||||
optional: bool = SettingsField(title="Optional")
|
||||
active: bool = SettingsField(title="Active")
|
||||
attribute: list[ValidatePluginPathAttributesAttrModel] = SettingsField(
|
||||
|
|
@ -310,6 +310,9 @@ class RendererAttributesModel(BaseSettingsModel):
|
|||
|
||||
|
||||
class ValidateRenderSettingsModel(BaseSettingsModel):
|
||||
enabled: bool = SettingsField(title="Enabled")
|
||||
optional: bool = SettingsField(title="Optional")
|
||||
active: bool = SettingsField(title="Active")
|
||||
arnold_render_attributes: list[RendererAttributesModel] = SettingsField(
|
||||
default_factory=list, title="Arnold Render Attributes")
|
||||
vray_render_attributes: list[RendererAttributesModel] = SettingsField(
|
||||
|
|
@ -613,7 +616,7 @@ class ExtractGPUCacheModel(BaseSettingsModel):
|
|||
title="Optimize Animations For Motion Blur"
|
||||
)
|
||||
writeMaterials: bool = SettingsField(title="Write Materials")
|
||||
useBaseTessellation: bool = SettingsField(title="User Base Tesselation")
|
||||
useBaseTessellation: bool = SettingsField(title="User Based Tessellation")
|
||||
|
||||
|
||||
class PublishersModel(BaseSettingsModel):
|
||||
|
|
@ -1171,6 +1174,8 @@ DEFAULT_PUBLISH_SETTINGS = {
|
|||
]
|
||||
},
|
||||
"ValidateRenderSettings": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"arnold_render_attributes": [],
|
||||
"vray_render_attributes": [],
|
||||
"redshift_render_attributes": [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue