您可以在音序器对象上使用 cmds.listConnections 获取您的镜头列表 . 之后,使用 for 循环并使用 cmds.getAttr 获取镜头的信息,如下所示:
shots = cmds.listConnections("sequencer1", type="shot") or [] # Get a list of all shots from the sequencer.
for shot in shots:
shot_name = cmds.getAttr("{}.shotName".format(shot)) # Query shot's name.
start_frame = cmds.getAttr("{}.startFrame".format(shot)) # Query shot's start frame.
end_frame = cmds.getAttr("{}.endFrame".format(shot)) # Query shot's end frame.
print shot_name, start_frame, end_frame # Print out shot's info.
1 回答
欢迎来到SO,Fantasi .
你提出了一个非常模糊的问题,所以作为回报,你会得到一个非常含糊的答案 .
您可以在音序器对象上使用
cmds.listConnections
获取您的镜头列表 . 之后,使用for
循环并使用cmds.getAttr
获取镜头的信息,如下所示:具有2个镜头的音序器的示例输出:
如果你're unsure about the shot object'属性名称然后you can find them here .
如果您仍有问题,我建议您从脚本编辑器粘贴错误消息,以便我们可以诊断出错了什么 .