Jump to content

SopNode object is not iterable - python


MatDuf

Recommended Posts

Hi! I have a problem with what strikes me as a simple task.

 

I made this simplified test setup (see image): 4 boxes in a geometry node all going into a merge node.

 

I select the merge node and run the following python script from a shelf tool (Don't bother about the purpose of this... This is only to show my problem):

 
myMerge=hou.selectedNodes()[0]
toDel = []
myBoxes=list(myMerge.inputs())
print(myBoxes[0])
toDel.extend(myBoxes[0])

This will fail at the last line that is supposed to add a single member of the myBoxes list to the toDel list. It throws the error in the second image. What bothers me is that the print statement works appropriately but for some reason, the same structure doesn't work to add the item to the list.

 

Am I just missing something??

 

Thanks!

post-13044-0-60884400-1430995001_thumb.j

post-13044-0-27764600-1430995144_thumb.j

Edited by MatDuf
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...