lib.py 文件源码

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

项目:maya-capture-gui 作者: Colorbleed 项目源码 文件源码
def get_time_slider_range(highlighted=True,
                          withinHighlighted=True,
                          highlightedOnly=False):
    """Return the time range from Maya's time slider.

    Arguments:
        highlighted (bool): When True if will return a selected frame range
            (if there's any selection of more than one frame!) otherwise it
            will return min and max playback time.
        withinHighlighted (bool): By default Maya returns the highlighted range
            end as a plus one value. When this is True this will be fixed by
            removing one from the last number.

    Returns:
        list: List of two floats of start and end frame numbers.

    """
    if highlighted is True:
        gPlaybackSlider = mel.eval("global string $gPlayBackSlider; "
                                   "$gPlayBackSlider = $gPlayBackSlider;")
        if cmds.timeControl(gPlaybackSlider, query=True, rangeVisible=True):
            highlightedRange = cmds.timeControl(gPlaybackSlider,
                                                query=True,
                                                rangeArray=True)
            if withinHighlighted:
                highlightedRange[-1] -= 1
            return highlightedRange
    if not highlightedOnly:
        return [cmds.playbackOptions(query=True, minTime=True),
                cmds.playbackOptions(query=True, maxTime=True)]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号