jtChannelBox_Commands_Default.py 文件源码

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

项目:ModularChannelBox 作者: Vaei 项目源码 文件源码
def channelbox_command_precision(box, menuItem, key, *args):
    # floating point value displayed in channel box, eg. value of 5 will
    #  display 5 decimal places
    with sysCmd.Undo(0):
        old_precision = box.saved_states[key][0]
        new_precision = mel.eval("precisionPrompt (\"\", " + str(old_precision) + ", 15);")

        if new_precision > 0:  # Change widths of the fields depending on the precision
            if new_precision <= 3:
                new_width = 65
            elif new_precision <= 6:
                new_width = 95
            elif new_precision <= 9:
                new_width = 115
            elif new_precision <= 12:
                new_width = 130
            else:
                new_width = 155

            cmds.channelBox(box.channelbox, e=1, pre=new_precision, fieldWidth=new_width)
            box.saved_states[key][0] = new_precision
            box.saved_states["fieldWidth"][0] = new_width

        sysCmd.channelbox_save_state(box)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号