9 class ViewType(object):
26 VIEW_SCENEEXPLORER = 16
36 for item
in ViewType.__dict__:
37 theValue = ViewType.__dict__[item]
44 def RemoveRenderedFile(file):
45 if os.path.exists(file):
50 '''Creates an array of spheres in a cone like shape'''
53 theSphere.ParameterBlock.Radius.Value = sphere_radius
57 for i
in range(0, revolutions, 20):
59 radians = math.radians(i)
60 x = radius * math.cos(radians)
61 y = radius * math.sin(radians)
67 def MaximizePerspective():
68 '''This function finds the first perspective viewport, makes it active and maximizes it.'''
70 skipPerspective =
False
78 for view
in MaxPlus.ViewportManager.Viewports:
79 viewType = view.GetViewType()
81 if ((viewType == ViewType.VIEW_PERSP_USER)
and (
not found)):
82 typeString = ViewType.GetKey(viewType)
87 print "Found Perspective Viewport. Index:", perspIndex
88 if (perspIndex != -1):
94 def SetRenderParameters():
95 '''Set some common render parameters'''
96 outputPath = os.path.join(
101 render.SetOutputFile(outputPath)
102 print "Saving file to:", render.GetOutputFile()
103 render.SetSaveFile(
True)
110 MaximizePerspective()
111 path = SetRenderParameters()
113 RemoveRenderedFile(path)