added km and miles, updated context access

This commit is contained in:
Ondřej Samohel 2022-02-09 10:51:53 +01:00
parent 36ba36f52c
commit bc355b2279
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
3 changed files with 25 additions and 9 deletions

View file

@ -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"]

View file

@ -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": [],

View file

@ -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"}
]
},
{