import maya
def showNarrowPolyViewer():
window = maya.cmds.window()
form = maya.cmds.formLayout()
editor = maya.cmds.spNarrowPolyViewer()
column = maya.cmds.columnLayout(adjustableColumn=True)
maya.cmds.button(label="Wireframe", command=("maya.cmds.spNarrowPolyViewer(\"%s\",edit=True,displayAppearance=\"wireframe\")" % (editor, )))
maya.cmds.button(label="Points", command=("maya.cmds.spNarrowPolyViewer(\"%s\",edit=True,displayAppearance=\"points\")" % (editor, )))
maya.cmds.button(label="Bounding Box", command=("maya.cmds.spNarrowPolyViewer(\"%s\",edit=True,displayAppearance=\"boundingBox\")" % (editor, )))
maya.cmds.button(label="Smooth Shaded", command=("maya.cmds.spNarrowPolyViewer(\"%s\",edit=True,displayAppearance=\"smoothShaded\")" % (editor, )))
maya.cmds.button(label="Flat Shaded", command=("maya.cmds.spNarrowPolyViewer(\"%s\",edit=True,displayAppearance=\"flatShaded\")" % (editor, )))
maya.cmds.floatField("angleTolerance",minValue=0,maxValue=180,value=10,step=1,precision=1,ann="tolerance",cc=("maya.cmds.spNarrowPolyViewer(\"%s\", edit=True,tol=maya.cmds.floatField(\"angleTolerance\",q=True,v=True))" % (editor, )), \
ec = ("maya.cmds.spNarrowPolyViewer(\"%s\", edit=True,tol=maya.cmds.floatField(\"angleTolerance\",q=True,v=True))" % (editor, )), dc = ("maya.cmds.spNarrowPolyViewer(\"%s\", edit=True,tol=maya.cmds.floatField(\"angleTolerance\",q=True,v=True))" % (editor, )), \
rfc = ("maya.cmds.spNarrowPolyViewer(\"%s\", edit=True,tol=maya.cmds.floatField(\"angleTolerance\",q=True,v=True))" % (editor, )))
maya.cmds.formLayout(form,edit=True,attachForm=(column, "top",0))
maya.cmds.formLayout(form,edit=True,attachForm=(column, "left",0))
maya.cmds.formLayout(form,edit=True,attachNone=(column, "bottom"))
maya.cmds.formLayout(form,edit=True,attachNone=(column, "right"))
maya.cmds.formLayout(form,edit=True,attachForm=(editor, "top", 0), attachControl = (editor, "left", 0, column))
maya.cmds.formLayout(form,edit=True,attachForm=(editor, "bottom", 0))
maya.cmds.formLayout(form,edit=True,attachForm=(editor, "right", 0))
camera = maya.cmds.camera(centerOfInterest=2.450351, position=(1.535314,1.135712,1.535314), rotation=(-27.612504,45,0), worldUp=(-0.1290301,0.3488592,-0.1290301))
g__MpTestPrimaryCamera = camera[0];
maya.cmds.spNarrowPolyViewer(editor,edit=True,camera=camera[0])
maya.cmds.currentTime(10.0,edit=True)
maya.cmds.spNarrowPolyViewer(editor,edit=True,i=True)
maya.cmds.refresh()
maya.cmds.spNarrowPolyViewer(editor,edit=True,r=True)
maya.cmds.showWindow(window)