mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
supports the check on only one keyframe in timeline
This commit is contained in:
parent
478406baff
commit
2caf32c5b0
2 changed files with 19 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.1.6"
|
||||
__version__ = "0.1.7"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue