supports the check on only one keyframe in timeline

This commit is contained in:
Kayla Man 2024-03-06 23:08:40 +08:00
parent 478406baff
commit 2caf32c5b0
2 changed files with 19 additions and 2 deletions

View file

@ -8,6 +8,23 @@ from ayon_core.pipeline import (
from ayon_core.hosts.max.api.action import SelectInvalidAction
def get_invalid_keys(obj):
"""function to check on whether there is keyframe in
Args:
obj (str): object needed to check if there is a keyframe
Returns:
bool: whether invalid object(s) exist
"""
for transform in ["Position", "Rotation", "Scale"]:
num_of_key = rt.NumKeys(rt.getPropertyController(
obj.controller, transform))
if num_of_key > 0:
return True
return False
class ValidateNoAnimation(pyblish.api.InstancePlugin,
OptionalPyblishPluginMixin):
"""Validates No Animation
@ -45,6 +62,6 @@ class ValidateNoAnimation(pyblish.api.InstancePlugin,
list: list of invalid objects
"""
invalid = [invalid for invalid in instance.data["members"]
if invalid.isAnimated]
if invalid.isAnimated or get_invalid_keys(invalid)]
return invalid

View file

@ -1 +1 @@
__version__ = "0.1.6"
__version__ = "0.1.7"