Jump to content

How to get the current network type category on the Network Editor Pane in python?


willlinks

Recommended Posts

Hello,
I'm trying to network type category (like sop, dop, lop ...) on the Network Editor Pane in Python.
I could get the parent node of the network on the current Network Editor so far.

def get_network_type():
	# Find the node of the network showed on a current Network Editor Pane. 
	desktop = hou.ui.curDesktop()
	pane =  desktop.paneTabOfType(hou.paneTabType.NetworkEditor)
	parent_node = pane.pwd()
	
	# I'd like to get the network type category of the inside of the parent_node (like Sop, Lop, Object, CopNet, TopNet etc).
	network_type = ??????

	return network_type

I have some case that I'm viewing the Sop network in sop_create Lop node or Vop network  in material_library Lop so it is not necessary to be the top or parent network is the same network type I'm viewing on the current Network Editor pane.
I could pick one node in the current network to figure out the network type by getting node type but I also have situation that there are no node in the network yet but I need to figure out the network type.

It would be really nice to have some help.
Thank you in advance!

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