Hi,
I’m again impressed what is currently possible with ovito-python. Currently, I’m trying to write a simple standalone LAMMPS trajectory viewer based on the example B4. This is based on ovito.gui.create_qwidget().
It’s working well so far, I managed to implement atom sizes, atom colors, polyhedron rendering.
What I didn’t accomplish is:
How to set the background color for the viewport?
It doesn’t work like this:
vp_widget = ovito.gui.create_qwidget(vp)
vp_widget.background_color = (0.5, 0.5, 0.5) # gray background? not working
central_layout.addWidget(vp_widget, 1)
Furthermore, it appears to work in default OpenGL rendering mode. How do I set the anari renderer? I tried something like this:
anari = AnariRenderer( # how to invoke correctly?
[...]
)
def on_time_slider(frame: int):
ovito.scene.anim.current_frame = frame
# ovito.scene.anim.renderer= anari # --> this is not working
I would really appreciate if you could help me out.
There’s another observation. In my system, if I move the slider “fast”, the images rendered immediately during the movement are rendered in a “default” style (with atoms in CPK-like style) and after a split second - my defined style is then rendered.
Thank you!