vtkAxesTransformRepresentation fails with vtkVectorText.cxx: Text is not set! when used from python
When running the python script below (based on the c++ test script) the following error occurs:
ERROR: In vtkVectorText.cxx, line 63
vtkVectorText (0000028D654D31A0): Text is not set!
ERROR: In vtkExecutive.cxx, line 741
vtkCompositeDataPipeline (0000028D66A55C30): Algorithm vtkVectorText (0000028D654D31A0) returned failure for request: vtkInformation (0000028D66A1E5E0)
Debug: Off
Modified Time: 3176
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
FROM_OUTPUT_PORT: 0
Reproduce:
Using
python: 3.11
vtk 9.2.5 qt_py311hdcb56fe_202 conda-forge
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkFiltersSources import vtkCubeSource
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkPolyDataMapper,
vtkRenderWindow,
vtkRenderWindowInteractor,
vtkRenderer
)
import vtk
def main():
colors = vtkNamedColors()
# Create a rendering window and renderer.
ren = vtkRenderer()
renWin = vtkRenderWindow()
renWin.SetWindowName('Cube1')
renWin.AddRenderer(ren)
# Create a renderwindowinteractor.
iren = vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
# Create cube.
cube = vtkCubeSource()
cube.Update()
# mapper
cubeMapper = vtkPolyDataMapper()
cubeMapper.SetInputData(cube.GetOutput())
# Actor.
cubeActor = vtkActor()
cubeActor.SetMapper(cubeMapper)
cubeActor.GetProperty().SetColor(colors.GetColor3d('Banana'))
# Assign actor to the renderer.
ren.AddActor(cubeActor)
rep = vtk.vtkAxesTransformRepresentation()
aw = vtk.vtkAxesTransformWidget()
aw.SetInteractor(iren)
aw.SetRepresentation(rep)
# Enable user interface interactor.
iren.Initialize()
renWin.Render()
aw.On()
iren.Start()
if __name__ == '__main__':
main()