ml_centerOfMass.py 文件源码

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

项目:ml_tools 作者: morganloomis 项目源码 文件源码
def meshesFromHistory(control):
    '''
    Return all visible meshes downstream from a given control.
    '''

    #try searching backward first for speed
    meshes = []
    allMeshes = mc.ls(type='mesh')
    for mesh in allMeshes:
        hist = mc.listHistory(mesh, allConnections=True)
        if control in hist:
            if isNodeVisible(mesh):
                meshes.append(mesh)

    if meshes:
        return meshes

    #if we didn't find any, search forward from control
    #this takes a bit longer
    hier = mc.listRelatives(control, ad=True, pa=True)
    if not hier:
        hier = [control]
    else:
        hier.append(control)

    hist = mc.listHistory(hier, future=True, allFuture=True, allConnections=True)
    hist = list(set(hist))
    meshes = mc.ls(hist, type='mesh')
    meshes = [x for x in meshes if isNodeVisible(x)]

    return meshes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号