definnegan Posted April 11, 2015 Share Posted April 11, 2015 (edited) I often run into problems with the houdini viewport, particularly working with volumes, where things get "stuck" in the viewport or are otherwise inaccurately represented. I'll have the display flag on a null, have "hide other objects" turned on, and still some volume I was looking at 5 minutes ago remains in the viewport. Or, for another fun example, everything just all of a sudden becomes the same color as the background viewport color and I can only see where things are by turning on point display. The only solution I've found is to close the scene view and open another one, which trashes all your viewport settings (visibility, camera view, normals display, selection settings, pinning, everything), so then you gotta go clicking around resetting everything, and then the viewport craps out again 5 minutes later. I finally got sick of doing that, so I whipped up a little shelf tool that has the effect of fixing some of the bogus display issues that I've encountered, and somehow maintaining all the viewport settings (nothing clever there, I just got lucky). It identifies all the scene viewers in your desktop, turns them into textports, and then turns them back into scene viewers. Here's the tool, I hope it saves you some time and frustration. Enjoy! ####get list of panes#### panes = hou.ui.paneTabs() viewers = [] ####identify scene viewers#### for p in panes: if p.type() == hou.paneTabType.SceneViewer: viewers.append(p) ###turn scene viewers into textports, then back into scene viewers#### for v in viewers: trickview = v.setType(hou.paneTabType.Textport) newview = trickview.setType(hou.paneTabType.SceneViewer) # Dan Finnegan, FX TD: definnegan@gmail.com # Edited April 11, 2015 by definnegan Quote Link to comment Share on other sites More sharing options...
definnegan Posted April 14, 2015 Author Share Posted April 14, 2015 Yeah, this doesn't work like I expected it to. Ignore this, it's probably useless! Quote Link to comment Share on other sites More sharing options...
Guest tar Posted April 14, 2015 Share Posted April 14, 2015 the viewport zombie bug- we keep killing it, and it keeps coming back Quote Link to comment Share on other sites More sharing options...
Skybar Posted April 14, 2015 Share Posted April 14, 2015 Yeah it happened to me a few days ago, I was surprised to find it in H14 with the new viewport and all - it took me a while to realise it actually was that bug and not me being crazy. Quote Link to comment Share on other sites More sharing options...
definnegan Posted April 17, 2015 Author Share Posted April 17, 2015 This actually works, I changed the script to just delete any current scene views and make new ones in any panes that they exist in. You lose all your scene viewer settings, but you save a few seconds not having to close your scene view and create a new one. ¡¡¡¡WARNING!!!! Don't run this if you have a pane open that contains only 1 tab, and that tab is a scene viewer, unless you love crashing houdini. ####get list of panes#### panes = hou.ui.paneTabs() sceneviewers = [] ####identify scene viewers#### for p in panes: if p.type() == hou.paneTabType.SceneViewer: sceneviewers.append(p) ###delete current scene viewers and create replacements #### for v in sceneviewers: pane = v.pane() pane.createTab(hou.paneTabType.SceneViewer) v.close() # Dan Finnegan, FX TD: definnegan@gmail.com # Quote Link to comment Share on other sites More sharing options...
Guest tar Posted April 19, 2015 Share Posted April 19, 2015 So far I've picked up that volumes and particles tend to be the things that get stuck in the viewport. Is anyone getting polygons or other things stuck too? Thanks! Quote Link to comment Share on other sites More sharing options...
Solitude Posted April 20, 2015 Share Posted April 20, 2015 Would be nice if until they figure out the root cause of the problem that SESI could just added a proper opengl refresh function to python, or a refresh button on the viewport itself. Something like hou.ui.refreshOpenGl() and it completely blew out the gl buffer and re-initialized it from scratch with the same display settings.. Anything to just flush it and rebuild it would be nice. It's rather disurptive to have my viewport set nicely for whatever I'm working on, and then having to close it because some geo got stuck, then have to open a new tab, set my display options back to what I had it (say dark for volumes, certain attributes displayed, etc), and then get back to work. Volumes and particles tend to be the worst, but I've been working with a lot of geometry lately, and it also happens with geo too. Quote Link to comment Share on other sites More sharing options...
Guest tar Posted April 20, 2015 Share Posted April 20, 2015 Yeah - maybe Rfe a 'break in emergency' style command that refreshes everything but keeps settings. Perhaps if/when Vulkan gets implemented the whole architecture can put on new foundations that abstracts the way the viewport is updated. Quote Link to comment Share on other sites More sharing options...
definnegan Posted May 1, 2015 Author Share Posted May 1, 2015 (edited) I found some time to polish the script up a bit, and I'm pretty happy with how it turned out. Forget my previous posts, this script is the real deal. It'll retain your camera settings (if you've got one set, otherwise it retains your persp transformations). It also retains all the viewport settings that I could pythonically/hscript-onically script. On a side[fx] note, if you're reading this, why not not list every hscript command when one runs exhelp? I've always relied on exhelp to look up hscript commands, and just recently learned that there are so many more documented online than are listed via exhelp. And they're useful! Every hscript command I used in this script is unlisted via exhelp and has a python equivalent that is, as far as I know, "not yet implemented". #####get list of panes#### panes = hou.ui.paneTabs() sceneviewers = [] curDesktop = hou.ui.curDesktop() desktopName = curDesktop.name() #####identify scene viewers#### for p in panes: if p.type() == hou.paneTabType.SceneViewer: sceneviewers.append(p) ####delete current scene viewers and create replacements #### for v in sceneviewers: ###collect viewport settings#### Pin = v.isPin() linkGroup = v.linkGroup() GroupListColoringGeometry = v.isGroupListColoringGeometry() GroupListShowingEmptyGroups = v.isGroupListShowingEmptyGroups() GroupListVisible = v.isGroupListVisible() GroupPicking = v.isGroupPicking() PickingCurrentNode = v.isPickingCurrentNode() PickingVisibleGeometry = v.isPickingVisibleGeometry() SecureSelection = v.isSecureSelection() WholeGeometryPicking = v.isWholeGeometryPicking() PickFacing = v.pickFacing() PickGeometryType = v.pickGeometryType() PickModifier = v.pickModifier() PickStyle = v.pickStyle() #####get old scene viewer name, create new viewer, and get its name.################################### pane = v.pane() currentName = v.pane().desktop().name() + "." + v.name() + ".world" + "." + v.curViewport().name() newview = pane.createTab(hou.paneTabType.SceneViewer) newName = newview.pane().desktop().name() + "." + newview.name() + ".world" newNamePersp = newview.pane().desktop().name() + "." + newview.name() + ".world" +"." + newview.curViewport().name() #####if old scene viewer was looking through a camera, make new scene viewer look through #####the same camera. If not, match the persp view of the new viewer to the persp view of the old camera = v.curViewport().camera() if camera is None: viewTransform = hou.hscript("viewtransform -p %s"%currentName)[0] newTransform = viewTransform.replace(currentName, newNamePersp) hou.hscript("%s"%newTransform) else: newview.curViewport().setCamera(hou.node(camera.path())) hou.hscript("viewcopy %s %s"%(currentName, newNamePersp)) ###set the new viewer to "hide other objects", to prevent unwanted cooking ####set the left viewport toolbar to be visible, because why would you not want it do be... hou.hscript("vieweroption -a 0 %s"%newName) hou.hscript("viewerstow -l open %s"%newName) ####set viewport settings############ newview.setPin(Pin) newview.setLinkGroup(linkGroup) newview.setGroupListColoringGeometry(GroupListColoringGeometry) newview.setGroupListShowingEmptyGroups(GroupListShowingEmptyGroups) newview.setGroupListVisible(GroupListVisible) newview.setGroupPicking(GroupPicking) newview.setPickingCurrentNode(PickingCurrentNode) newview.setPickingVisibleGeometry(PickingVisibleGeometry) newview.setSecureSelection(SecureSelection) newview.setWholeGeometryPicking(WholeGeometryPicking) newview.setPickFacing(PickFacing) newview.setPickGeometryType(PickGeometryType) newview.setPickModifier(PickModifier) newview.setPickStyle(PickStyle) ########################################################################## v.close() ## Dan Finnegan, FX TD: definnegan@gmail.com # Edited May 1, 2015 by definnegan 1 Quote Link to comment Share on other sites More sharing options...
pezetko Posted May 2, 2015 Share Posted May 2, 2015 There is help command for hscript commands and exhelp command for hscript expressions Quote Link to comment Share on other sites More sharing options...
definnegan Posted May 3, 2015 Author Share Posted May 3, 2015 Learn something new every day! Thanks for the tip. Quote Link to comment Share on other sites More sharing options...
ChargingImage Posted September 29, 2015 Share Posted September 29, 2015 (edited) Because I'm not that fluent with programing (closer to... "at all"), is there a way to prevent this script from going up few levels (until on object level) if you are in vopsop? Pinning does the trick, but I have to pin it everytime I want to refresh. But aside of that: GREAT script. It will be quite often used. Thank you. Edited September 29, 2015 by ChargingImage Quote Link to comment Share on other sites More sharing options...
Atom Posted September 29, 2015 Share Posted September 29, 2015 (edited) I keep experiencing a complete viewport fritz when playing the Crowd Sim, which I guess it particle based. This bug does not exist in H14.396 (which is what I am currently using) but was introduced in all builds after that. I have reported it and SESI sent me an email that they are looking into it. After the "fritz" nothing can be drawn in the viewport. Restart Houdini It looks like this... Edited September 29, 2015 by Atom Quote Link to comment Share on other sites More sharing options...
Guest tar Posted September 29, 2015 Share Posted September 29, 2015 I keep experiencing a complete viewport fritz when playing the Crowd Sim, which I guess it particle based. This bug does not exist in H14.396 (which is what I am currently using) but was introduced in all builds after that. I have reported it and SESI sent me an email that they are looking into it. After the "fritz" nothing can be drawn in the viewport. Restart Houdini It looks like this... You could check a few things: try clearing the OpenGL Texture/Vertex Cache in the menu Window/Cache Manager. Under Optimise in Display Option try modifying the 'Crowd Agents' values. Also in Display Options, the top right 'i' will give some info about the framebuffer. Quote Link to comment Share on other sites More sharing options...
Atom Posted September 29, 2015 Share Posted September 29, 2015 Thanks I'll look into that next time I pull down a build. 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.