0
我試圖創建一個自動化通過包裝多邊形面到另一個多邊形如何在Maya中使用Python選擇新生成的節點?
# This script wrap a polygon face to the targeted terrain
import maya.cmds as cmds
# select terrain first, then the face
cmds.select('terrain', r = True)
cmds.select('face', add = True)
# wrapping a polygon face to the terrain
cmds.transferAttributes(transferPositions = 1)
# NEW Node transferAttributes1 is created, change its attribute searchMethod to 1.
cmds.setAttr('transferAttributes1.searchMethod' , 1)
# transferAttributes1 is generated after execution of
# cmds.transferAttributes(transferPositions = 1).
# The name might be different, such as transferAttributes2, transferAttributes3, etc.
# and cmds.setAttr('transferAttributes1.searchMethod' , 1) might give errors.
我的問題複製的形狀:有沒有什麼辦法來選擇新的transferAttributes
節點,並把它傳遞給cmds.setAttr()
?
PS:transferAttributes*.searchMethod
可能工作,但它會選擇所有的transferAttributes
節點。
萬分感謝! –
cmds.transferAttributes(transferPositions = 1)返回一個字符串列表。 new_node打印[u'transferAttributes1'],所以cmds.setAttr(new_node [0] +'。searchMethod',1) –
固定,我沒有檢查內存。 Thansk – theodox