#!/usr/bin/python # visit -cli -geometry 640x480 -s ShockTubeVolumeRendering.py # visit -cli -nowin -s ShockTubeVolumeRendering.py # print PlotPlugins() print "VTF VisIt Movie Frame Dumper (One-at-a-time Version) 2006 v.0.1" HideToolbars() false=0 true =1 windowAttributes = SaveWindowAttributes() windowAttributes.fileName = "/dev/null/shot.shocktube.BLANK.ppm" windowAttributes.format = windowAttributes.PNG windowAttributes.width = 640 windowAttributes.height = 480 windowAttributes.family = 0 SetSaveWindowAttributes(windowAttributes) lightSetup=GetLight(0) lightSetup.direction=(-0.616,-0.596,-0.515) lightSetup.direction=(-6,-1,-5) SetLight(0,lightSetup) viewAttributes = View3DAttributes() annotations = AnnotationAttributes() annotations.axesFlag=0 annotations.bboxFlag=1 annotations.triadFlag=0 annotations.gradientBackgroundStyle=annotations.TopToBottom annotations.gradientColor1 =(255,255,255,255) annotations.gradientColor2 =(223,223,223,255) annotations.backgroundMode =annotations.Gradient annotations.userInfoFlag =0 annotations.databaseInfoFlag=0 annotations.legendInfoFlag =1 SetAnnotationAttributes(annotations) first =1 fullview=0 volumerendering=1 viewSetup=View3DAttributes() fluidColorScale=PseudocolorAttributes() fluidColorScale.minFlag=1 fluidColorScale.maxFlag=1 fluidColorScale.min= 0.50 fluidColorScale.max= 1.00 fluildVolumeRendering=VolumeAttributes() fluildVolumeRendering.useColorVarMin=1 fluildVolumeRendering.useColorVarMax=1 fluildVolumeRendering.colorVarMin= 0.50 fluildVolumeRendering.colorVarMax= 1.00 fluildVolumeRendering.opacityAttenuation = 0.8 fluildVolumeRendering.resampleTarget = 10000000 # 10000000 max samples clipSetup=ClipAttributes() clipSetup.plane1Status=0 clipSetup.plane2Status=1 clipSetup.plane3Status=1 startFrame = 1 endFrame = 70+1 stepBetweenFrames = 1 for i in range(startFrame,endFrame,stepBetweenFrames): # HARDWIRED NOTICE: windowAttributes.fileName = "shots/shot.shocktube.%03i.png" % i # HARDWIRED NOTICE: fluidfile = "shocktube.%06i.silo" % i SetSaveWindowAttributes(windowAttributes) print "Opening ",fluidfile OpenDatabase(fluidfile) if volumerendering == 1: AddPlot("Volume","VAR_DENSITY/ALL_LEVELS") SetPlotOptions(fluildVolumeRendering) else: AddPlot("Pseudocolor","VAR_DENSITY/ALL_LEVELS") SetPlotOptions(fluidColorScale) AddOperator("Clip") SetOperatorOptions(clipSetup) DrawPlots() if first == 1: # let visit setup near/far planes and such, then just rotate the cannister viewSetup = GetView3D() # VIEW SETUP: imported from session # // viewSetup.viewNormal = ( -0.994206, 0.0959506, 0.0484523) # // viewSetup.viewUp = ( 0.0292883,0.675518, -0.736762) # // viewSetup.centerOfRotation = (5,0,0) if fullview == 1: viewSetup.centerOfRotation = (5,0,0) viewSetup.centerOfRotationSet = false viewSetup.eyeAngle = 2 viewSetup.farPlane = 10.025 viewSetup.focus = (5,0,0) viewSetup.imagePan = (0.00711994,0.00334017) viewSetup.imageZoom = 5.83332 viewSetup.nearPlane = -10.025 viewSetup.parallelScale = 5.01248 viewSetup.perspective = true viewSetup.viewAngle = 30 viewSetup.viewNormal = (-0.994206,0.0959506,0.0484523) viewSetup.viewUp = (0.0292883,0.675518,-0.736762) else: viewSetup.centerOfRotation = (5,0,0) viewSetup.centerOfRotationSet = false viewSetup.eyeAngle = 2 viewSetup.farPlane = 10.025 viewSetup.focus = (5,0,0) viewSetup.imagePan = (-0.246716,-0.0348233) viewSetup.imagePan = (-0.23,-0.0348233) viewSetup.imageZoom = 8.10077 viewSetup.nearPlane = -10.025 viewSetup.parallelScale = 5.01248 viewSetup.perspective = true viewSetup.viewAngle = 30 viewSetup.viewNormal = (-0.546913,0.331628,0.768706) viewSetup.viewUp = (0.10363,0.937954,-0.330913) print viewSetup first = 0 SetView3D (viewSetup) SaveWindow() HideActivePlots() DeleteAllPlots() ClearWindow() CloseDatabase(fluidfile) #ShowToolbars() print "Done!" CloseComputeEngine() Close()