Ich versuche, eine Automatisierung zu schaffen eine Form durch Wickeln eines Polygonfläche auf eine andere PolygonformWie neu generierten Knoten mit Python in Maya auswählen?
# 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.
Meine Frage zu kopieren: Gibt es eine Möglichkeit, die neuen transferAttributes
Knoten und übergeben es an cmds.setAttr()
zu wählen?
PS: transferAttributes*.searchMethod
könnte funktionieren, aber es werden alle transferAttributes
Knoten ausgewählt.
Dank einer Million! –
cmds.transferAttributes (transferPositions = 1) gibt eine String-Liste zurück. new_node gibt [utransferAttributes1 '] aus, also cmds.setAttr (new_node [0] +'. searchMethod ', 1) –
Behoben, ich habe es aus dem Speicher ohne Überprüfung gemacht. Thansk – theodox