print "############################################################"
fp_bas = '/root/work/cache'
fp_tar = 'E:\work\cache'
fpn_tar = fp_tar.decode('ascii').replace(chr(92),'/')
root = hou.node('/')
all_nodes = root.allSubChildren()
for n in all_nodes:
if n.type().name() == 'filecache':
if not 'setLoader' in n.path():
fp = n.evalParm('file')
fpn = fp.replace(fp_bas,fpn_tar)
n.parm('file').set(fpn)
print n.path()
print fpn
print "----"
---------------------------
Reference HP: Thx a lot.
- Pythonで文字列を置換(replace, translate, re.sub, re.subn)https://note.nkmk.me/python-str-replace-translate-re-sub/
- Python で ¥ (円マーク)を直接指定して置換するには http://yoshidabenjiro.hatenablog.com/entry/2016/12/24/232150
- ascii code backslash https://theasciicode.com.ar/ascii-printable-characters/backslash-reverse-slash-ascii-code-92.html
No comments:
Post a Comment