Forum Navigation
You need to log in to create posts and topics.

Is there any way to load a existing .ovito state file in a Python script?

Sometimes it would be very useful when the dump file is too large for saving the time scanning frames.

Currently, the Python script cannot load a .ovito state file by itself, but the ovitos Python script interpreter provides a command line option for preloading a state file. The Python script will then run in an environment where the data pipeline from the state file already exists and can be accessed by the script. See here:

https://ovito.org/docs/current/python/introduction/running.php#preloading-session-state

Very thanks for you reply.

I thought if this feature is achieved in the normal Python script, loading .ovito can be available for the Juypter Notebook or many other Python environments, which saves a lot time for data processing works.

Thank you for the suggestion. Currently there are technical reasons that limit the loading of a session state file to the time before a Python script runs. It cannot be performed after the script has already started running and loaded the ovito module, this is why only the ovitos interpreter supports this operation. But we'll check if a redesign of OVITO's Python interface is possible in the future that will allow loading state files at script runtime. I agree that this capability could be useful from a user's perspective in certain situations.