LaidlawFX Posted June 11, 2019 Share Posted June 11, 2019 Hello, I am trying to set the path of the current scene viewport via a button press from a hda. I know these python docs below are the key, but I can't seem to tie the relevant python functions together. https://www.sidefx.com/docs/houdini/hom/hou/PaneTab.html https://www.sidefx.com/docs/houdini/hom/hou/PathBasedPaneTab.html https://www.sidefx.com/docs/houdini/hom/hou/SceneViewer.html https://www.sidefx.com/docs/houdini/hom/hou/GeometryViewport.html Any help would be great. Thanks, -Ben Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted June 11, 2019 Author Share Posted June 11, 2019 Ok I figured it out a bit based on this chat. This code was put into the Python Source Editor. If you have a geometry object /obj/geo1 in your scene, it will change the path of the SceneViewer to node. It will do a simple check if it is pinned and pin it. Probably could use a bunch of exceptions... import hou node = hou.node('/obj/geo1') scene_pane = hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer) if scene_pane.isPin() : scene_pane.setPin(False) scene_pane.setPwd(node) scene_pane.setPin(True) https://www.sidefx.com/docs/houdini/hom/hou/ui.html to https://www.sidefx.com/docs/houdini/hom/hou/Desktop.html which needs one of these https://www.sidefx.com/docs/houdini/hom/hou/paneTabType.html Then you can use these. https://www.sidefx.com/docs/houdini/hom/hou/PathBasedPaneTab.html Hope that helps future me, and other fine folks. 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.