Toggling Panel Display Through Python Removes Hold-Out

Toggling Panel Display Through Python Removes Hold-Out

Anonymous
Not applicable
625 Views
0 Replies
Message 1 of 1

Toggling Panel Display Through Python Removes Hold-Out

Anonymous
Not applicable

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)
0 Likes
626 Views
0 Replies
Replies (0)