This pipeline batch-renders .xyz trajectory files using OVITO from two perspectives:
- Top view (looking down Z)
- 45° front view (XY diagonal)
Each trajectory is rendered in an isolated subprocess to avoid memory leaks and global state issues.
create_avi_movies_spectroscopies/
├── pp_xyz_movies/ # Input .xyz files
│ ├── movie_S1_h2o_top_o_hb.xyz
│ ├── ...
├── rendered_movies/ # Output .avi files
│ ├── movie_S1_h2o_top_o_hb_top.avi
│ ├── movie_S1_h2o_top_o_hb_front.avi
├── render_one.py # Renders one trajectory
├── main_render.py # Loops over and renders all trajectories
Always follow the official installation instructions when available.
conda create -n render_ovito python=3.10
conda activate render_ovito
conda install --strict-channel-priority \
-c https://conda.ovito.org \
-c conda-forge \
ovito=3.12.3
conda install -c conda-forge ase ipython jupyterlab
- Cleans
rendered_movies/(removes files only) - Creates
TMP/folder insidepp_xyz_movies/ - For each
.xyzfile:- Copies it into a temp folder
- Calls
render_one.pyas a subprocess - Moves resulting movies to
rendered_movies/
- Loads the trajectory using OVITO
- Hides the simulation cell
- Renders two perspectives:
- Top view: camera_dir = (0, 0, -1)
- Front view: camera_dir = (-1, 1, 0)
- Uses
TachyonRendererfor ray-traced images
- Output format is
.avi - Rendering is sandboxed to avoid OVITO bugs
- Tested with OVITO
3.12.3from official channel