我正在编写一个脚本,它将记录用户的一些动作并播放它们,现在只关注透视摄像机的移动。通过使用scriptJob命令,我可以在设置后捕获相机属性,但我理想的脚本将捕获翻滚过程中的所有相机移动。有没有办法做到这一点?
当前脚本如下所示:
def startRecording():
cmds.scriptJob(attributeChange=["persp.rotate", recordValuesAtTime])
cmds.scriptJob(attributeChange=["persp.translate", recordValuesAtTime])
def playback():
for e in events:
# lerp from starting position to next position for each event
答案 0 :(得分:1)
我想你几乎拥有它。您只需在scriptJob设置中(在MEL中)需要正确的触发事件:
scriptJob -event ($triggerEvent) recordVauesAtTime;
其中$ triggerEvent可能是 cameraChange 或 glFrameTrigger 。您可以使用(也是MEL)获取事件列表:
$list = `scriptJob -listEvents`;
for ($it in $list) {
print ($it+"\n");
}
尝试找错最合适的事情会被警告,有些人可能真的会用一系列事件来抨击Maya。