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

compute dislocation velocity through python script


thanks for this useful platform.

I want to compute the dislocation velocity using the python script, but I got a error like this:

User-defined function parameter 'output' must be declared with a default value.

the version of OVITO Pro I used is 3.5.4

Could you please tell me where I go wrong? thanks very much.

Uploaded files:


your script was written for the old OVITO 2.9 release, and OVITO's Python API got a major redesign when the 3.x series was introduced in ca. 2018. OVITO Pro 3.5.4 can execute scripts for OVITO 2.9 only to a limited extent, and at least a few updates to the script code will be necessary to make it work with the current version of OVITO Pro's Python module.

You can either use the old OVITO 2.9 to run your script as is, or make the require changes to the code. For example, the error message you get is due to a change in how user-defined modifier functions work. Instead of get_dislocation_position(frame, input, output) they now must use the signature get_dislocation_position(frame, data) and manipulate the DataCollection data in-place, see the docs.

We as developers of OVITO can do all the porting of the old script code for you, but please note that we typically do so only for paying licensees of our software who are supporting us.


New for our users in China: OVITO on WeChat 

Official OVITO WeChat channel operated by Foshan Diesi Technology Co., Ltd.