|
11 | 11 | if basename is None:
|
12 | 12 | basename = "/tmp"
|
13 | 13 |
|
14 |
| -Version = (str(servermanager.vtkSMProxyManager.GetVersionMajor()) + "." + |
15 |
| - str(servermanager.vtkSMProxyManager.GetVersionMinor())) |
| 14 | +Version = (servermanager.vtkSMProxyManager.GetVersionMajor(), |
| 15 | + servermanager.vtkSMProxyManager.GetVersionMinor(), |
| 16 | + servermanager.vtkSMProxyManager.GetVersionPatch()) |
16 | 17 |
|
17 | 18 | info = vtkPVOpenGLInformation()
|
18 | 19 | info.CopyFromObject(None)
|
|
49 | 50 | sphere.ThetaResolution = 1024
|
50 | 51 | sphere.PhiResolution = 1024
|
51 | 52 |
|
52 |
| -pidscal = ProcessIdScalars(sphere) |
| 53 | +if Version <= (5, 11, 2): |
| 54 | + pidscal = ProcessIdScalars(sphere) |
| 55 | +else: |
| 56 | + pidscal = GenerateProcessIds(Input=sphere) |
53 | 57 |
|
54 | 58 | rep = Show(pidscal, view)
|
55 |
| -ColorBy(rep, 'ProcessId') |
56 |
| -processIdLUT = GetColorTransferFunction('ProcessId') |
| 59 | + |
| 60 | +if Version <= (5, 11, 2): |
| 61 | + ColorBy(rep, 'ProcessId') |
| 62 | + processIdLUT = GetColorTransferFunction('ProcessId') |
| 63 | +else: |
| 64 | + ColorBy(rep, ('POINTS', 'PointProcessIds')) |
| 65 | + processIdLUT = GetColorTransferFunction('PointProcessIds') |
| 66 | + |
57 | 67 | processIdLUT.AnnotationsInitialized = 1
|
58 | 68 | processIdLUT.InterpretValuesAsCategories = 1
|
59 | 69 |
|
|
95 | 105 | view.ViewSize = [1024, 1024]
|
96 | 106 |
|
97 | 107 | # change the pathname to a place where you have write access
|
98 |
| -filename = basename + "/coloredSphere_v" + Version + "." + Vendor + ".png" |
| 108 | +SourceVersion = servermanager.vtkSMProxyManager.GetParaViewSourceVersion() |
| 109 | +filename = basename + "/coloredSphere_v" + SourceVersion.split()[-1] + "." + Vendor + ".png" |
99 | 110 | SaveScreenshot(filename=filename, view=view)
|
100 | 111 | print("writing ", filename)
|
0 commit comments