ml_copyAnim.py 文件源码

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

项目:ml_tools 作者: morganloomis 项目源码 文件源码
def copySingle(source=None, destination=None, pasteMethod='replace', offset=0, addToLayer=False, rotateOrder=True):
    '''
    Copy animation from a source node and paste it to a destination node
    '''

    start, end = _getStartAndEnd()

    if not source and not destination:
        sel = mc.ls(sl=True)
        if len(sel) != 2:
            OpenMaya.MGlobal.displayWarning('Please select exactly 2 objects.')
            return

        source = sel[0]
        destination = sel[1]

    layer = None
    if addToLayer:
        layer = utl.createAnimLayer(destination, namePrefix='ml_cp')

    copyAnimation(source=source, destination=destination, pasteMethod=pasteMethod, offset=offset, start=start, end=end, layer=layer, rotateOrder=rotateOrder)

    #if sel:
        #mc.select(sel)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号