Jump to content

All node names in one single Message Window


Symbolic

Recommended Posts

Hi,

I have been playing around with python for a while. I have the following problem.

inside = self.children()

will give me the list of what ever is there inside a node.

hou.ui.displayMessage(str(inside[0]))

will display a nice windows with the first name in the array in it.

But if I just go:

hou.ui.displayMessage(str(inside))

It goes creazy like:

(<hou.ObjNode of type geo at /obj>,)

How can I create a proper window listing node names properly?

Thanks.

Edited by Symbolic
Link to comment
Share on other sites

One small thing... what if want to add a string like "and" in between each name?

childnames = [child.name() for child in mynode.children()]
hou.ui.displayMessage(" and ".join(childnames))

join() is a methoid of strings, not array/list/tuples like in other languages.

Confused me for a while, too.

Link to comment
Share on other sites

childnames = [child.name() for child in mynode.children()]
hou.ui.displayMessage(" and ".join(childnames))

join() is a methoid of strings, not array/list/tuples like in other languages.

Confused me for a while, too.

Ow. :blink: really confusing...

:)

Thanks for the help.

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...