Jump to content

Parent as Selected


CinnamonMetal

Recommended Posts

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()

Link to comment
Share on other sites

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 by CinnamonMetal
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...