View Full Version : controlling viewport display - python

09-02-2011, 09:32 PM
I wrote a tool to take a screen capture, but I want to be able to control what is visible.

I want to turn off all lights, cameras, nulls, x-ray mode and only want geometry visible and be in textured mode with all lights.

how can I control this in python? I can't find any documentation at all on this.
thanks can be a simple one line how to set the viewport visibilites, that's what i would expect.

any info? thanks!

09-02-2011, 11:24 PM
You can use the modelEditor command.

import maya.cmds as mc
panel = mc.getPanel(wf=1)
mc.modelEditor(panel, e=1, allObjects=0)
mc.modelEditor(panel, e=1, polymeshes=1)
mc.modelEditor(panel, e=1, xray=1)
mc.modelEditor(panel, e=1, displayTextures=1)
mc.modelEditor(panel, e=1, displayLights='all')

09-03-2011, 10:26 AM
all of those viewport settings are controlled by the modelEditor command.

CGTalk Moderation
09-03-2011, 10:26 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.