def modifyExtrude(self, teeth=10, length=0.3):
faces = self.getTeethFaces(teeth)
# The extrude node has an attribute called inputComponents
# To change it we can use a simple setAttr call instead of recreating the extrude which can be expensive
# The arguments to changing a list of components is slightly different than a simple setAttr
# it is:
# cmds.setAttr('extrudeNode.inputComponents', numberOfItems, item1, item2, item3, type='componentList')
cmds.setAttr('%s.inputComponents' % self.extrude, len(faces), *faces, type='componentList')
# The *faces will be new to you.
# It basically means to expand a list in place for arguments
# so if the list has ['f[1]', 'f[2]'] etc, it will be expanded in the arguments to be like this
# cmds.setAttr('extrudeNode.inputComponents', 2, 'f[1]', 'f[2]', type='componentList'
# Finally we modify the length
self.changeLength(length)
评论列表
文章目录