Skyrush Posted April 27, 2023 Share Posted April 27, 2023 Hi, I have to get the last character of the node's name into group parameter of blast node. In this case, the name of blast node is blast1, so I need the last character 1, and put it in into group parameter. nodeName = hou.node(".") last_char = nodeName[-1] return(last_char) And I get error Error: Unable to evaluate expression ( Traceback (most recent call last): File "<stdin>", line 3, in expression TypeError: 'SopNode' object is not subscriptable (/obj/geo1/blast1/group)). Quote Link to comment Share on other sites More sharing options...
haggi Posted April 27, 2023 Share Posted April 27, 2023 (edited) The problem is that hou.node() returns an object, not a string. With something like nodeName = hou.node(".").name() it could work better. Edited April 27, 2023 by haggi 1 Quote Link to comment Share on other sites More sharing options...
Skyrush Posted April 27, 2023 Author Share Posted April 27, 2023 Perfect, thank you! 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.