How to access vtkRenderer from CLI

Hi all.
I would like to update the renderer as the vtk poly data changes(vtkPolyDataWriter) within a CLI loop.
Is there a way to force the renderer to re-render?
It seems that it would be possible from a python script, but not a CLI module?


Right - a CLI is meant to be able to run independent of Slicer (just using command line arguments) so it doesn’t know about renderers or the rest of the GUI.

Sometimes a reasonable approach is to write the inner loop in the CLI and then call it repeatedly from a scripted module that triggers the redraws.

Worth noting that by unchecking the option Prefer CLI executable in Settings -> Modules, the CLI will be called as a function pointer and overhead of writing input and output to disk is removed.