I'm trying to find out what category/context a networkItem(netbox, sticky, dot) is in via python.
working with nodes is easy:
selection = hou.selectedNodes()
print selection.type().category().name()
If I selected a bunch of sop nodes, it would return “Sop”
My question is how do I get the equivalent of: .category().name() from a networkItem?
my selection is now a tuple of items mixed with nodes:
selection = hou.selectedItems()
If my fist selection item is a dot/sticky/netbox, there is no type() property. So if I selected a netbox in a sop context, I'd like a hou fn to return “Sop”
Cheers
HOU: How to get a networkItem's categoy/context equivalent ?
1875 2 0-
- AlexLombardi
- Member
- 30 posts
- Joined: 10月 2011
- Offline
-
- mtucker
- スタッフ
- 4529 posts
- Joined: 7月 2005
- Offline
That's because a network box, or dot, or sticky note in a SOP context is indistinguishable from a network box, dot, or sticky note in an OBJ context. These things don't have “types”… I guess I'd start by asking why you need this information? If you are just trying to figure out the type of nodes that can be created in the same network as these items, you can do:
item.parent().childTypeCategory().name()
Is that what you're looking for?
item.parent().childTypeCategory().name()
Is that what you're looking for?
-
- AlexLombardi
- Member
- 30 posts
- Joined: 10月 2011
- Offline
-
- Quick Links