top of page

Code snippet: Rigging replace chop node names

Ellie Ansell


def replacePath(old, new):
    '''
    replace path name
    '''
    node = hou.selectedNodes()
    nodes = [n for n in node if "chopnet" in n.type().name()]
    for i, n in enumerate(nodes):
        nodes = n.children()
        children = [n for n in nodes if "inversekin" in n.type().name()]
        
        for c in children:
            print c
            bonerootpath = c.parm("bonerootpath").eval().replace(old, new)
            boneendpath = c.parm("boneendpath").eval().replace(old, new)
            endaffectorpath = c.parm("endaffectorpath").eval().replace(old, new)
            twistaffectorpath = c.parm("twistaffectorpath").eval().replace(old, new)
            
            c.parm("bonerootpath").set(bonerootpath)
            c.parm("boneendpath").set(boneendpath)
            c.parm("endaffectorpath").set(endaffectorpath)
            c.parm("twistaffectorpath").set(twistaffectorpath)
            
replacePath("/../../", "../../")   


16 views0 comments

Recent Posts

See All

Comentários


  • LinkedIn // Professional Bio
  • Facebook // ellieansellart page
  • Instagram // Informal fun
  • Vimeo

© 2020 by Ellie Ansell

Happily created using Wix.com

bottom of page