itsjustregi
2024年2月1日 11:00:08
* EDIT...Glitch...seems now the the toggle mode is now working properly
Hi,
Looking to see if there is a way to bypass the limitation of shortcuts being
set to viewport rendering shading. While working on a model, I would like
to have to ability to switch into "xray" aka wireframe ghost with a hotkey.
But for some reason you can not set this or any other shading mode via hotkey.
Is there anyway around this?
I also have Wire toggle mode set to Wireframe Ghost...but this seems to not work
Houdini 20.0.590
Thanks
animatrix_
2024年2月1日 13:11:06
Hi,
You can implement these in Python and drag over to a shelf to create a shelf tool which you can assign a hotkey too. For example to toggle between hidden line and wireframe modes:
def toggleHiddenLineWireframe():
with hou.undos.disabler():
editor = hou.ui.paneTabUnderCursor()
if not editor:
editor = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer)
if editor:
editortype = editor.type()
if editortype == hou.paneTabType.SceneViewer:
settings = editor.curViewport().settings()
displayset = settings.displaySet(hou.displaySetType.DisplayModel)
shading = hou.glShadingType.WireGhost if displayset.shadedMode() == hou.glShadingType.HiddenLineInvisible else hou.glShadingType.HiddenLineInvisible
displayset.setShadedMode(shading)