csp Posted March 11, 2015 Share Posted March 11, 2015 How can I get the path to current network view/parent node in Python? cheers Quote Link to comment Share on other sites More sharing options...
csp Posted March 11, 2015 Author Share Posted March 11, 2015 I figured it out! import toolutils activepane = toolutils.activePane(kwargs) parent = activepane.pwd().path() Quote Link to comment Share on other sites More sharing options...
csp Posted March 13, 2015 Author Share Posted March 13, 2015 (edited) Apparently this code work only from inside self-tool script! When I try to run it though an imported script as part of pyqt interface will not work because of kwargs. EDIT: No worries, I fixed it myself, again! I pass the kwargs as argument to the imported script. Edited March 13, 2015 by cparliaros Quote Link to comment Share on other sites More sharing options...
csp Posted March 14, 2015 Author Share Posted March 14, 2015 I will continue to correct myself as nobody else willing to contribute Apparently the script above will give me the parent node of the active Scene View pane which will always be under /obj. But what I want is the parent node of the active Network View pane. I can't find anything one that. Quote Link to comment Share on other sites More sharing options...
edward Posted March 14, 2015 Share Posted March 14, 2015 I don't understand. You can just get the parent of any node you want: http://www.sidefx.com/docs/houdini14.0/hom/hou/Node#parent Quote Link to comment Share on other sites More sharing options...
ayidi Posted March 14, 2015 Share Posted March 14, 2015 The parent node of the active Network View pane import hou def activeNetworkPanes(): desktop = hou.ui.curDesktop() panes = desktop.paneTabs() network_panes = [] for pane in panes: if isinstance(pane, hou.NetworkEditor): if pane.isCurrentTab(): network_panes.append(pane) return network_panes root_node = None selected_nodes = hou.selectedNodes() network_panes = activeNetworkPanes() if selected_nodes: root_node = selected_nodes[-1].parent() elif network_panes: root_node = network_panes[0].pwd() 1 Quote Link to comment Share on other sites More sharing options...
csp Posted March 14, 2015 Author Share Posted March 14, 2015 import hou def activeNetworkPanes(): desktop = hou.ui.curDesktop() panes = desktop.paneTabs() network_panes = [] for pane in panes: if isinstance(pane, hou.NetworkEditor): if pane.isCurrentTab(): network_panes.append(pane) return network_panes root_node = None selected_nodes = hou.selectedNodes() network_panes = activeNetworkPanes() if selected_nodes: root_node = selected_nodes[-1].parent() elif network_panes: root_node = network_panes[0].pwd() Thanks Arthur, thats exactly what I was looking for! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.