亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

從 Maya 鏡頭列表中獲取 Attr

從 Maya 鏡頭列表中獲取 Attr

滄海一幻覺 2021-09-11 20:34:25
我想從鏡頭列表中的字段中獲取信息(在相機音序器中)。我解決的鏡頭名稱:test = cmds.getAttr('shot1.sn') print test但其余的......我被卡住了。當我嘗試調用像 startTime 這樣的其他參數時,我會收到各種錯誤,具體取決于我嘗試的方式。
查看完整描述

1 回答

?
精慕HU

TA貢獻1845條經驗 獲得超8個贊

歡迎來到 SO,Fantasi。


你提出了一個非常模糊的問題,所以作為回報,你會得到一個非常模糊的答案。


您可以通過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.

帶有 2 個鏡頭的音序器的示例輸出:


輸出:


射擊 1.0 50.0


射擊結束 51.0 120.0


如果您不確定鏡頭對象的屬性名稱,則可以在此處找到它們。


如果您仍然有問題,我建議您粘貼來自腳本編輯器的錯誤消息,以便我們可以診斷出問題所在。


查看完整回答
反對 回復 2021-09-11
  • 1 回答
  • 0 關注
  • 187 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號