def set_position_keys(target, keyframes):
"""
Function animates the position 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 x, float y, float z]], ...]
"""
for keyframe in keyframes: # For every keyframe from the list of keyframes scale object at proper time
cmds.setKeyframe(target, attribute='translateX', v=keyframe[0][0], time=keyframe[1], itt="fast", ott="fast")
cmds.setKeyframe(target, attribute='translateY', v=keyframe[0][1], time=keyframe[1], itt="fast", ott="fast")
cmds.setKeyframe(target, attribute='translateZ', v=keyframe[0][2], time=keyframe[1], itt="fast", ott="fast")
评论列表
文章目录