From bc355b22798a0e64c4b53953d25d4622ec14a26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Wed, 9 Feb 2022 10:51:53 +0100 Subject: [PATCH] added km and miles, updated context access --- .../plugins/publish/validate_maya_units.py | 6 +++--- .../defaults/project_settings/maya.json | 19 ++++++++++++++----- .../schemas/schema_maya_publish.json | 9 ++++++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/validate_maya_units.py b/openpype/hosts/maya/plugins/publish/validate_maya_units.py index db0f48279f..d5a8c350d5 100644 --- a/openpype/hosts/maya/plugins/publish/validate_maya_units.py +++ b/openpype/hosts/maya/plugins/publish/validate_maya_units.py @@ -30,8 +30,8 @@ class ValidateMayaUnits(pyblish.api.ContextPlugin): def process(self, context): # Collected units - linearunits = context.data('linearUnits') - angularunits = context.data('angularUnits') + linearunits = context.data.get('linearUnits') + angularunits = context.data.get('angularUnits') # TODO(antirotor): This is hack as for framerates having multiple # decimal places. FTrack is ceiling decimal values on # fps to two decimal places but Maya 2019+ is reporting those fps @@ -39,7 +39,7 @@ class ValidateMayaUnits(pyblish.api.ContextPlugin): # rounding, we have to round those numbers coming from Maya. # NOTE: this must be revisited yet again as it seems that Ftrack is # now flooring the value? - fps = float_round(context.data['fps'], 2, ceil) + fps = float_round(context.data.get('fps'), 2, ceil) asset_fps = lib.get_asset()["data"]["fps"] diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 52b8db058c..611e3da181 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -188,6 +188,20 @@ "whitelist_native_plugins": false, "authorized_plugins": [] }, + "ValidateMayaUnits": { + "enabled": true, + "optional": false, + "validate_linear_units": true, + "linear_units": "cm", + "validate_angular_units": true, + "angular_units": "deg", + "validate_fps": true + }, + "ValidateUnrealStaticMeshName": { + "enabled": true, + "validate_mesh": false, + "validate_collision": true + }, "ValidateCycleError": { "enabled": true, "optional": false, @@ -195,11 +209,6 @@ "rig" ] }, - "ValidateUnrealStaticMeshName": { - "enabled": true, - "validate_mesh": false, - "validate_collision": true - }, "ValidateRenderSettings": { "arnold_render_attributes": [], "vray_render_attributes": [], diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json index e2b61489de..be45f892e1 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json @@ -140,6 +140,11 @@ "type": "boolean", "key": "enabled", "label": "Enabled" + }, + { + "type": "boolean", + "key": "optional", + "label": "Optional" }, { "type": "boolean", @@ -156,9 +161,11 @@ {"mm": "millimeter"}, {"cm": "centimeter"}, {"m": "meter"}, + {"km": "kilometer"}, {"in": "inch"}, {"ft": "foot"}, - {"yd": "yard"} + {"yd": "yard"}, + {"mi": "mile"} ] }, {