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("/../../", "../../")

Comentários