7 class ViewType(object):
24 VIEW_SCENEEXPLORER = 16
34 for item
in ViewType.__dict__:
35 theValue = ViewType.__dict__[item]
41 def RemoveRenderedFile(file):
42 if os.path.exists(file):
46 '''Creates an array of spheres in a cone like shape'''
50 theSphere.ParameterBlock.Radius.Value = sphere_radius
54 for i
in range(0,revolutions,20):
56 radians = math.radians(i)
57 x = radius * math.cos( radians )
58 y = radius * math.sin( radians )
63 def MaximizePerspective():
64 '''This function finds the first perspective viewport, makes it active and maximizes it.'''
66 skipPerspective =
False
74 for view
in MaxPlus.ViewportManager.Viewports:
75 viewType = view.GetViewType()
77 if ((viewType == ViewType.VIEW_PERSP_USER)
and (found ==
False)):
78 typeString = ViewType.GetKey(viewType)
83 print "Found Perspective Viewport. Index:", perspIndex
84 if (perspIndex != -1):
89 def SetRenderParameters():
90 '''Set some common render parameters'''
95 render.SetOutputFile( outputPath )
96 print "Saving file to:", render.GetOutputFile()
97 render.SetSaveFile(
True )
103 MaximizePerspective()
104 path = SetRenderParameters()
106 RemoveRenderedFile(path)