I have been trying all day to set the viewport background to black and disable the grid from Python.
I got this far, so I managed to get the viewport and I set it to dark, but nothing happens. Any ideas? What I try to do is setup the scene so its better before generating a flipbook.
####To get the viewport a = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer) b = a.viewports() tviewport = b #this will get the perspective viewport tviewport.home() #will focus it home tview_settings = tviewport.settings() tview_settings.setColorScheme = hou.viewportColorScheme.Dark
The other option is to set the flipbook to render "Beauty Pass Only" which will avoid rendering the background gradient, grid, handles, etc, making it much closer to a render (Render - Current Viewport -> Beauty Pass Only in the flipbook dialog).
Thanks that is helpful. I still have a few issues with the beauty pass For example it will still render the objects with visible edges if that was set in the viewport (which is normally what I have while working). But yes, it fixed the background and got rid of gizmos which is useful. One weird thing is that the lighting is much darker with the beauty pass. Hmm, I notice mplay looks fine, but the jpg that I save are darker when I use the beauty pass. Not sure why
Hi, nothing is happening because you're actually querying the colorScheme instead of setting it.
So, the correct last line should be : tview_settings.setColorScheme(hou.viewportColorScheme.Dark) instead of : tview_settings.setColorScheme = hou.viewportColorScheme.Dark
(I know that this is an old post, but it's the 1st google result, I'm replying just in case of someone is searching the same thing)
# apply the sceme current_scheme = display_settings.colorScheme()
for s in schemes: if s == current_scheme: next_id = schemes.index(s)+1 next_id = next_id % len(schemes) next_scheme = schemes[next_id] display_settings.setColorScheme(next_scheme) msg = f"viewport background set to {next_scheme.name()}" hou.ui.setStatusMessage(msg) return
cycle_display_bg() ### follow me on instagram @movfx