settings for camera content validator

This commit is contained in:
Ondřej Samohel 2022-06-08 12:09:13 +02:00
parent 8d0bb493e8
commit 082fb1d29d
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
3 changed files with 32 additions and 0 deletions

View file

@ -20,6 +20,7 @@ class ValidateCameraContents(pyblish.api.InstancePlugin):
hosts = ['maya']
label = 'Camera Contents'
actions = [openpype.hosts.maya.api.action.SelectInvalidAction]
validate_shapes = True
@classmethod
def get_invalid(cls, instance):
@ -49,6 +50,8 @@ class ValidateCameraContents(pyblish.api.InstancePlugin):
raise RuntimeError("No cameras found in empty instance.")
if not cls.validate_shapes:
return
# non-camera shapes
valid_shapes = cmds.ls(shapes, type=('camera', 'locator'), long=True)
shapes = set(shapes) - set(valid_shapes)

View file

@ -413,6 +413,11 @@
"optional": true,
"active": true
},
"ValidateCameraContents": {
"enabled": true,
"optional": true,
"validate_shapes": true
},
"ExtractPlayblast": {
"capture_preset": {
"Codec": {

View file

@ -570,6 +570,30 @@
}
]
},
{
"type": "dict",
"collapsible": true,
"key": "ValidateCameraContents",
"label": "Validate Camera Content",
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"type": "boolean",
"key": "optional",
"label": "Optional"
},
{
"type": "boolean",
"key": "validate_shapes",
"label": "Validate presence of shapes"
}
]
},
{
"type": "splitter"
},