Ryan Posted August 3, 2018 Share Posted August 3, 2018 (edited) I wanted to share this script with you guys. As we all know, viewport issues randomly occur at times. Geometry doesn't display properly, templated geo sticks to the view and doesn't go away, camera gets stuck in ortho mode, etc. So a common fix for this is to just close the viewport and make a new one. I have written a script you can add on your shelf for your convenience: cur = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer,0) vp = cur.curViewport() so = vp.settings().displaySet(hou.displaySetType.SceneObject) fb = cur.flipbookSettings() somode = so.shadedMode() cam = hou.node("/obj").createNode("cam") vp.saveViewToCamera(cam) cam.parm("projection").set(0) new = cur.pane().createTab(hou.paneTabType.SceneViewer) nvp = new.curViewport() ndm = nvp.settings().displaySet(hou.displaySetType.DisplayModel) nso = nvp.settings().displaySet(hou.displaySetType.SceneObject) nso.setShadedMode(somode) nvp.setCamera(cam) ndm.setLinkToDisplaySet(hou.displaySetType.SceneObject) new.flipbookSettings().copy(fb) cur.close() cam.destroy() This will also save your current camera position, shaded mode, and flipbook settings. Enjoy! Edited August 3, 2018 by Ryan 2 2 Quote Link to comment Share on other sites More sharing options...
Skybar Posted August 3, 2018 Share Posted August 3, 2018 Very useful and works really well! Thanks! 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.