在帧之间移动关键点 - Maya Graph Editor
move the key between frames - Maya Graph Editor
我在 Graph Editor 中有很多键,在缩放它们之后,Maya 已经在帧之间移动了其中的一些键,(帧 5,37-4'54-...)。我知道如何一个一个地移动它们,但我想创建任何脚本将它们放在 o 之后的一帧之前。
Select所有键-单击右键-捕捉选项不够
你可以这样做:
from maya import cmds
# Select the keys to be moved based on a time interval.
# For example the following commands will select keys between 5.01 and 5.99.
# Customize the interval and object/attributes based on your need.
cmds.selectKey(clear=True)
cmds.selectKey('pSphere1.tx', add=True, keyframe=True, time=(5.01, 5.99))
cmds.selectKey('pSphere1.ty', add=True, keyframe=True, time=(5.01, 5.99))
cmds.selectKey('pSphere1.tz', add=True, keyframe=True, time=(5.01, 5.99))
# Change the time of the selected keys to the correct value (for example 5.0)
cmds.keyframe(animation='keys', option='over', absolute=True, timeChange=5.0)
我在 Graph Editor 中有很多键,在缩放它们之后,Maya 已经在帧之间移动了其中的一些键,(帧 5,37-4'54-...)。我知道如何一个一个地移动它们,但我想创建任何脚本将它们放在 o 之后的一帧之前。
Select所有键-单击右键-捕捉选项不够
你可以这样做:
from maya import cmds
# Select the keys to be moved based on a time interval.
# For example the following commands will select keys between 5.01 and 5.99.
# Customize the interval and object/attributes based on your need.
cmds.selectKey(clear=True)
cmds.selectKey('pSphere1.tx', add=True, keyframe=True, time=(5.01, 5.99))
cmds.selectKey('pSphere1.ty', add=True, keyframe=True, time=(5.01, 5.99))
cmds.selectKey('pSphere1.tz', add=True, keyframe=True, time=(5.01, 5.99))
# Change the time of the selected keys to the correct value (for example 5.0)
cmds.keyframe(animation='keys', option='over', absolute=True, timeChange=5.0)