Text label overlay

This viewport overlay displays a user-defined text string in the rendered image. The text can contain placeholders to be replaced with the values of global attributes computed by OVITO's data pipeline. This makes it possible to display dynamic information such as the current simulation timestep, number of atoms, or analysis results in a rendered image or movie.

The lower panel displays the list of available attributes which can be incorporated into the label's text and which will be replaced with their current computed values.

Note that it is possible to define new attributes that are computed on the basis of other attributes by inserting a Python script modifier into the data pipeline. Consider for example the CommonNeighborAnalysis.counts.BCC attribute, which is output by the Common Neighbor Analysis modifier to report the number of BCC atoms found. If, instead of the absolute number of BCC atoms, we want to print the fraction of BCC atoms, we have to divide by the total number of atoms in the system. To this end we can define a new attribute named bcc_fraction by inserting a Python script modifier:

def modify(frame, input, output):
    n_bcc = input.attributes['CommonNeighborAnalysis.counts.BCC']
    n_total = input.number_of_particles
    output.attributes['bcc_fraction'] = n_bcc / n_total

This new attribute will subsequently become available in the Text Label overlay as a dynamic variable.

See also

TextLabelOverlay (Python API)