gears2.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PythonForMayaSamples 作者: dgovil 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号