def set_scale_keys(target, keyframes):
"""
Function animates the scale of given object by creating the given keyframes.
:param obj: String - Name of an object which scale will be animated
:param keyframes: Python list - Keyframes that will be created: [[int time, float scale (1 = 100%),] ...]
"""
for keyframe in keyframes: # For every keyframe from the list of keyframes scale object at proper time
scale_value = float(keyframe[0])
cmds.setKeyframe(target, attribute='scaleX', v=scale_value, time=keyframe[1], itt="fast", ott="fast")
cmds.setKeyframe(target, attribute='scaleY', v=scale_value, time=keyframe[1], itt="fast", ott="fast")
cmds.setKeyframe(target, attribute='scaleZ', v=scale_value, time=keyframe[1], itt="fast", ott="fast")
评论列表
文章目录