Adding a scale bar to a viewport

OVITO currently has no built-in function to add a length scale to an image, but it is possible to use an OVITO Python script to paint a custom scale bar on top of a viewport or the rendered images.

For this you have to add a Python script layer pro to the viewport where you want to display a scale bar. You can then copy/paste this example Python script pro into the script editor of the viewport layer.