Latimerias Posted January 20, 2022 Share Posted January 20, 2022 I have a tuple that I'm looping over like this: 'for name in tuple:'. Inside the loop I say something like createNode('group', name) but I get the error "invalid node name". Please help I am not sure why this is as it returns a string properly elsewhere! I also tried the .setName but got the same result. Quote Link to comment Share on other sites More sharing options...
Atom Posted January 21, 2022 Share Posted January 21, 2022 (edited) Perhaps your name is invalid? I run all my names through this function before attempting to use them as node names. import re def returnValidHoudiniNodeName(passedItem): # Thanks to Graham on OdForce for this function! # Replace any illegal characters for node names here. return re.sub("[^0-9a-zA-Z\.]+", "_", passedItem) Edited January 21, 2022 by Atom 1 Quote Link to comment Share on other sites More sharing options...
Latimerias Posted January 22, 2022 Author Share Posted January 22, 2022 Ah yes there was a weird name i found, clumsy mistake. Thanks for the function as well works perfectly! 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.