How to use Python to control the visualization button
535 1 0-
- c540843679
- Member
- 4 posts
- Joined: 7月 2022
- オフライン
Does anyone know how to control the on - off state of the visualization button on the viewport toolbar using Python? I haven't found any method to control this switch. The functionality of using hou.viewportVisualizers seems to be able to control only a single one, but I want to be able to toggle the whole group, just like when I click the visualization button on the viewport toolbar with the mouse.
-
- c540843679
- Member
- 4 posts
- Joined: 7月 2022
- オフライン
vis = hou.viewportVisualizers.visualizers(hou.viewportVisualizerCategory.Scene)
list =
for each in vis:
vname =each.label()
list.append(vname)
#desktop = hou.ui.curDesktop()
#pane = desktop.paneTabOfType(hou.paneTabType.SceneViewer)
pane = hou.ui.curDesktop().paneTabUnderCursor()
view = pane.curViewport()
sel = hou.ui.selectFromList(list, message='Select attri')
for s in sel:
v = vis
v.setIsActive(not v.isActive(view),view)
This is what I'm currently using, and it can only be controlled by making selections.
list =
for each in vis:
vname =each.label()
list.append(vname)
#desktop = hou.ui.curDesktop()
#pane = desktop.paneTabOfType(hou.paneTabType.SceneViewer)
pane = hou.ui.curDesktop().paneTabUnderCursor()
view = pane.curViewport()
sel = hou.ui.selectFromList(list, message='Select attri')
for s in sel:
v = vis
v.setIsActive(not v.isActive(view),view)
This is what I'm currently using, and it can only be controlled by making selections.
Edited by c540843679 - 2025年3月8日 08:09:28
-
- Quick Links