How to remove Defect Mesh from animation

I’d like to remove the Defect Mesh from Python. In the GUI I can unselect ‘Defect’ after having loaded the DislocationModifier then render my animation

This link makes no reference to defect_mesh so I’m not too sure how to access the defect mesh visual in order to disable it


You already posted the correct manual entry. :slight_smile: The defect_vis property of the DXA modifier gives you access to the SurfaceMeshVis element controlling the visual representation of the generated defect mesh. Moreover, the visibility of a so-called visual element, in general, can be controlled through its enabled property, as explained here: ovito.vis — OVITO Python Reference 3.10.6 documentation.

By the way, this is a perfect use case for OVITO Pro’s Python code generator function, which would allow you to quickly set up your pipeline and all render settings in the desktop application and then have OVITO Pro translate everything into the corresponding sequence of Python statements for you.