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