Message 1 of 1
Toggling Panel Display Through Python Removes Hold-Out
Not applicable
01-06-2020
11:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to toggle the display of certain objects in my viewport to render playblasts with only polygons and image planes visible. For some reason doing this through python seems to remove the holdout/useBackground effect on my polygons. Is there a way around this?
import maya.cmds as cmds panel = cmds.getPanel(wf = 1) if cmds.objExists('ToggleCheck'):
cmds.modelEditor(panel, e=1, allObjects=1)
cmds.modelEditor(panel, e=1, isFiltered= 0)
cmds.delete('ToggleCheck') else:
cmds.spaceLocator(n='ToggleCheck')
cmds.hide('ToggleCheck')
cmds.modelEditor(panel, e=1, allObjects=0)
cmds.modelEditor(panel, e=1, polymeshes=1, imp=1)