July 29, 2018, 18:51
|
Saving screenshot in Paraview Catalyst
|
#1
|
Member
Join Date: Jan 2018
Posts: 34
Rep Power: 8
|
I am working with Paraview Catalyst on a cluster to capture images for a simple dambreak case of openfoam. what I get is a blank white screen with axis. Can someone help?
Code:
def CreateCoProcessor():
def _CreatePipeline(coprocessor, datadescription):
class Pipeline:
input1 = coprocessor.CreateProducer(datadescription, "region")
slice2 = Slice(Input=input1, guiName="Slice2", Crinkleslice=0, SliceOffsetValues=[0.0], Triangulatetheslice=1, SliceType="Plane")
slice2.SliceType.Offset = 0.0
slice2.SliceType.Origin = [0.5, 0.5, 0.5]
slice2.SliceType.Normal = [0, 1, 0]
sliceWriter = servermanager.writers.XMLPPolyDataWriter(Input=slice2)
coprocessor.RegisterWriter(sliceWriter, filename='slice_%t.pvtp', freq=10)
imageDataWriter1 = servermanager.writers.XMLPImageDataWriter(Input=input1)
coprocessor.RegisterWriter(imageDataWriter1, filename='images_%t.pvti', freq=10)
paraview.simple._DisableFirstRenderCameraReset()
# Create a new 'Render View'
renderView0=CreateView('RenderView')
renderView0.ViewSize = [1920, 1080]
renderView0.AnnotationColor=[0.0, 0.0, 0.0]
renderView0.CameraPosition = [0.0, 0.0, 66.92130429902464]
renderView0.CameraParallelScale = 17.320508075688775
renderView0.Background = [1, 1, 1]
# coprocessor.RegisterView(renderView0, filename='image_%t.png', freq=10, fittoscreen=0, magnification=1, width=868, height=781,
# cinema={})
# renderView0.ViewTime = datadescription.GetTime()
# SetActiveView(renderView0)
# The code till above prints only blank images , with nothing in it. I've been trying to #pass data with Show(renderView0) or something similar, but was not able to make it #work.
a1_alpha_PVLookupTable=GetLookupTableForArray("alpha.water",1,RGBPoints=[0.0,0.0,0.5,0.0,0.635,1.0,0.5,0.0], VectorMode='Magnitude',
NanColor=[0.498039,0.498039,0.498039], ColorSpace='RGB',ScalarRangeInitialized=1.0,LockScalarRange=1)
a1_alpha_PiecewiseFunction = CreatePiecewiseFunction(Points=[0.0,0.0,0.5,0.0,0.635,1.0,0.5,0.0])
SetActiveSource(input1)
Datarepresentation1 = Show()
Datarepresentation1.ColorAttributeType='CELL_DATA'
Datarepresentation1.EdgeColor=[0.0, 0.0, 0.5]
Datarepresentation1.SelectionCellFieldDataArrayName='alpha.water'
Datarepresentation1.ScalarOpacityFunction=a1_alpha.PiecewiseFunction
Datarepresentation1.ColorArrayName = ('CELL_DATA','alpha.water')
Datarepresentation1.LookupTable = a1_alpha_PVLookupTable
Datarepresentation1.ColorAttributeType='CELL_DATA'
Datarepresentation1.ScalarOpacityUnitDistance = 0.004
Datarepresentation1.ScaleFactor=0.02
coprocessor.RegisterView(Datarepresentation1, filename='image_%t.png', freq=10, fittoscreen=0, magnification=1, width=868, height=781, cinema={})
renderView0.ViewTime = datadescription.GetTime()
return Pipeline()
|
|
|