Mykman Posted March 15, 2022 Share Posted March 15, 2022 Hi all! I have a problem with attribstringedit to replace characters in a string. It works well with / but not with \ . Is there a workaround for this limitation ? Like doing it in Vex or using ascii code instead of the \ character ? If anyone could help me out that would be amazing ! I`ve included a sample scene. escapeCharacterReplace.hiplc Quote Link to comment Share on other sites More sharing options...
Atom Posted March 15, 2022 Share Posted March 15, 2022 (edited) Sometimes path manipulations are easier to perform using Python. node = hou.pwd() geo = node.geometry() # Add code to modify contents of geo. # Use drop down menu to select examples. import re for p in geo.points(): s = p.attribValue("myPath") result = re.sub(r"\\\\",r"/",s) p.setAttribValue("myPath",result) Edited March 15, 2022 by Atom 1 Quote Link to comment Share on other sites More sharing options...
Mykman Posted March 16, 2022 Author Share Posted March 16, 2022 wow thanks Atom ! I have not thought about this ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.