CinnamonMetal Posted October 11, 2017 Share Posted October 11, 2017 paren = thisNode.parent() if paren == 0: print(paren) else: paren.setSelected(on,clear_all_selected=True) If the current node has a parent, set the parent as the current selected node; it's unfortunately not working ? Quote Link to comment Share on other sites More sharing options...
symek Posted October 12, 2017 Share Posted October 12, 2017 parent = thisNode.parent() if parent: parent.setSelected(True) Checking if parent exists in your code makes me suspicious about your goal though. Are you actually interested in hierarchy selection or network selection? Above code returns a network which contains a node: so for /obj/geo1 it will return /obj. For the ancestors nodes you have to use parents = thisNode.inputs() Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 13, 2017 Author Share Posted October 13, 2017 (edited) I wanted the hierarchy selection. inputs() retrieves the the parent node, which I thought was the node above, the PythonSOP. The parent node is the first node in the hierarchy. How do I get the node which in this case is the node one up before the PythonSOP ? As well setInput() doesn't accept index number ? Edited October 13, 2017 by CinnamonMetal 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.