Visualizing custom colors for dislocations in Ovito

Hi,

I have applied certain colors to dislocations using the custom_color option exposed by the ovito.data.DislocationNetwork (ovito.data — OVITO Python Reference 3.9.2 documentation).

After exporting the file in .ca format, how would I go about visualizing the dislocation lines using the custom color which I have applied in Ovito?

Thank you,
Raja

Hi,

Unfortunately, the .ca file format does not save color information for individual dislocations. What you would have to do is to assign the colors at runtime, e.g., with a Python modifier in OVITO Pro after having imported the .ca file.

Could you kindly direct me towards such a sample script which would modify the color of the dislocation lines. Which property would I need to modify for the dislocations?

You would do it in the same way you have already done it, just within the scope of a Python Script modifier in the Desktop application OVITO Pro.
(You already posted the link to a code example you can use above).