bentraje Posted February 21, 2022 Share Posted February 21, 2022 (edited) Hi, I have this code that creates new node: new_node = hou.node('/obj').createNode('node_name') Is there a way to retrieve the current opened context so that this part changes depending on the context? hou.node('/obj') Edited February 23, 2022 by bentraje Quote Link to comment Share on other sites More sharing options...
bentraje Posted February 23, 2022 Author Share Posted February 23, 2022 BigRoyNL from tech-artists helped me with the code. Here’s the working code I used for reference: desktop = hou.ui.curDesktop() pane = desktop.paneTabUnderCursor() current_context = pane.pwd() current_context.createNode('node_name') 1 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.