Recover OpenGL Informations from pvpython

(Mathieu Westphal (Kitware)) #1

The OpenGL informations, visible in Help -> About dialog, are not easily recoverable in pvpython yet.

Here is how to do it.

On ParaView 5.6 and earlier versions:

import vtk as VTK
openGLInfo=VTK.vtkPVOpenGLInformation() 
session=servermanager.vtkSMProxyManager.GetProxyManager().GetActiveSession()
session.GatherInformation(session.CLIENT, openGLInfo, 0)
openGLInfo.GetVendor()
openGLInfo.GetVersion()
openGLInfo.GetRenderer()
openGLInfo.GetCapabilities()

On ParaView master, 5.7 and newer:

openGLInfo=servermanager.vtkPVServerImplementationRendering.vtkPVClientServerCoreRendering.vtkPVOpenGLInformation()
session=servermanager.vtkSMProxyManager.GetProxyManager().GetActiveSession()
session.GatherInformation(session.CLIENT, openGLInfo, 0)
openGLInfo.GetVendor()
openGLInfo.GetVersion()
openGLInfo.GetRenderer()
openGLInfo.GetCapabilities()
(Utkarsh Ayachit) #2

how about adding a function to simple.py to gather and return the vtkPVOpenGLInformation object?

Also, you can use enums in Python now, so I’d recommend changing the 16 to appropriate enums for clarity.

(Mathieu Westphal (Kitware)) #3

This is indeed a good feature idea.

I’ve updated my post with the enums.

(Mathieu Westphal (Kitware)) #4

https://gitlab.kitware.com/paraview/paraview/merge_requests/3320