orientjoints.py 文件源码

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

项目:cmt 作者: chadmv 项目源码 文件源码
def __init__(self):
        name = 'cmt_orientjoints'
        if cmds.window(name, exists=True):
            cmds.deleteUI(name, window=True)
        if cmds.windowPref(name, exists=True):
            cmds.windowPref(name, remove=True)
        self.window = cmds.window(name, title='CMT Orient Joints', widthHeight=(358, 330))
        cmds.columnLayout(adjustableColumn=True)
        margin_width = 4
        cmds.frameLayout(bv=False, label='Quick Actions', collapsable=True, mw=margin_width)
        cmds.gridLayout(numberOfColumns=2, cellWidthHeight=(175, 65))
        cmds.button(label='Make Planar Orientation', command=self.make_planar)
        cmds.button(label='Project to Planar Position', command=partial(make_position_planar))
        cmds.button(label='Align Up With Child', command=self.align_with_child)
        cmds.button(label='Zero Orient', command=self.zero_orient)
        cmds.button(label='Orient to World', command=self.orient_to_world)
        cmds.rowColumnLayout(numberOfColumns=4)

        height = 20
        label_width = 60
        icon_left = 'nudgeLeft.png'
        icon_right = 'nudgeRight.png'
        cmds.text(label='Offset X', align='right', width=label_width)
        cmds.iconTextButton(style='iconOnly', image1=icon_left, label='spotlight', h=height, w=height, c=partial(self.offset_orient_x, direction=-1))
        self.offset_x = cmds.floatField(value=90.0)
        cmds.iconTextButton(style='iconOnly', image1=icon_right, label='spotlight', h=height, w=height, c=partial(self.offset_orient_x, direction=1))
        cmds.text(label='Offset Y', align='right', width=label_width)
        cmds.iconTextButton(style='iconOnly', image1=icon_left, label='spotlight', h=height, w=height, c=partial(self.offset_orient_y, direction=-1))
        self.offset_y = cmds.floatField(value=90.0)
        cmds.iconTextButton(style='iconOnly', image1=icon_right, label='spotlight', h=height, w=height, c=partial(self.offset_orient_y, direction=1))
        cmds.text(label='Offset Z', align='right', width=label_width)
        cmds.iconTextButton(style='iconOnly', image1=icon_left, label='spotlight', h=height, w=height, c=partial(self.offset_orient_z, direction=-1))
        self.offset_z = cmds.floatField(value=90.0)
        cmds.iconTextButton(style='iconOnly', image1=icon_right, label='spotlight', h=height, w=height, c=partial(self.offset_orient_z, direction=1))

        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.frameLayout(bv=False, label='Manual Orient', collapsable=True, mw=margin_width)
        cmds.columnLayout(adj=True)
        cmds.rowLayout(numberOfColumns=2, cw2=(150, 150))
        self.reorient_children = cmds.checkBox(label='Reorient children', value=True, align='left')
        self.reset_orientation = cmds.checkBox(label='Reset orientation', value=True, align='left')
        cmds.setParent('..')
        cmds.gridLayout(numberOfColumns=2, cellWidthHeight=(175, 65))
        cmds.button(label='Template Joints', command=partial(self.template_joints))
        cmds.button(label='Rebuild Joints', command=partial(rebuild_joints))
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.showWindow(self.window)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号