static Posted January 13, 2011 Share Posted January 13, 2011 (edited) Say I have a node, and on that node exists a button that cds to a different network. Usually this wouldn't be a problem, but I sometimes have more than one Network Editor pane open in my session. This can create complications, especially if for some reason, multiple panes are pointing to the same network (why, I don't know, but it happens). I just want to ensure that I'm jumping to the new network in the same network editor. With that being said, is there a way to get a node's paneTab object without relying on matching? here's an example of what I don't want to do: def getNetworkEditorPane(mynode): parent = mynode.parent() networkEditors = [x for x in hou.ui.paneTabs() if x.type() == hou.paneTabType.NetworkEditor] for net in networkEditors: if net.pwd() == parent: return net return None Sorry in advance for any syntax errors, I just threw this together off the top of my head. It should make sense though. Edited January 13, 2011 by static Quote Link to comment Share on other sites More sharing options...
graham Posted January 13, 2011 Share Posted January 13, 2011 There isn't a specific way since as you know you can have 2 editors pointing to the same path and there is really no "active" pane when 2 are displayed. Depending on how you have those 2 editors set up you can do something though. If you have the 2 editors as tabs in the same pane so that you can only have one displayed at a time then it's more straightforward. def getCurrentNetworkEditorPane(): editors = [pane for pane in hou.ui.paneTabs() if isinstance(pane, hou.NetworkEditor) and pane.isCurrentTab()] return editors[-1] This method searches for any editors that are the current (displayed) tabs. Since if they are both part of one pane then only one can be current. However, if you have 2 editors that are both displayed in different panes at the same network path then there isn't really anything you can do but something like the above but add in another layer of filtering and try and choose the one that is in a specific pane over the other one. 1 Quote Link to comment Share on other sites More sharing options...
static Posted January 13, 2011 Author Share Posted January 13, 2011 However, if you have 2 editors that are both displayed in different panes at the same network path then there isn't really anything you can do but something like the above but add in another layer of filtering and try and choose the one that is in a specific pane over the other one. Heh, unfortunately that is the case The info is helpful though. I didn't think about hou.PaneTab.isCurrentTab(). That will be able to help me at least narrow it down to visible editors. Cheers. Quote Link to comment Share on other sites More sharing options...
static Posted January 13, 2011 Author Share Posted January 13, 2011 Actually, if I were able to determine the pane that my mouse was over (since houdini is context sensitive to panes), that would solve the problem. I don't think that functionality has been promoted for their python implementation though. Methinks an email to SESI is in order. Quote Link to comment Share on other sites More sharing options...
static Posted January 14, 2011 Author Share Posted January 14, 2011 A stub exists for hou.ui.paneTabUnderMouse(), but it's not implemented. RFE submitted. Quote Link to comment Share on other sites More sharing options...
gemini Posted April 17, 2018 Share Posted April 17, 2018 (edited) HI, hou.ui.paneTabUnderMouse() Has it got in H16 ? THX Edited April 17, 2018 by gemini Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted September 6, 2018 Share Posted September 6, 2018 On 4/17/2018 at 3:39 PM, gemini said: HI, hou.ui.paneTabUnderMouse() Has it got in H16 ? In 16.5 this is implemented. 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.