Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maya: make render settings validator optional #474

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
RepairAction,
ValidateContentsOrder,
PublishValidationError,
OptionalPyblishPluginMixin
)
from ayon_core.hosts.maya.api import lib
from ayon_core.hosts.maya.api.lib_rendersettings import RenderSettings
Expand Down Expand Up @@ -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>`
Expand All @@ -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
Expand All @@ -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',
Expand Down Expand Up @@ -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:
Expand Down
13 changes: 9 additions & 4 deletions server_addon/maya/server/settings/publishers.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def validate_json(cls, value):

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

Expand Down Expand Up @@ -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):
Expand All @@ -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(
Expand All @@ -310,6 +310,9 @@ class RendererAttributesModel(BaseSettingsModel):


class ValidateRenderSettingsModel(BaseSettingsModel):
enabled: bool = SettingsField(title="Enabled")
optional: bool = SettingsField(title="Optional")
antirotor marked this conversation as resolved.
Show resolved Hide resolved
active: bool = SettingsField(title="Active")
arnold_render_attributes: list[RendererAttributesModel] = SettingsField(
default_factory=list, title="Arnold Render Attributes")
vray_render_attributes: list[RendererAttributesModel] = SettingsField(
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -1171,6 +1174,8 @@ class PublishersModel(BaseSettingsModel):
]
},
"ValidateRenderSettings": {
"enabled": True,
"optional": False,
antirotor marked this conversation as resolved.
Show resolved Hide resolved
"arnold_render_attributes": [],
"vray_render_attributes": [],
"redshift_render_attributes": [],
Expand Down
Loading