How to change the color of the selected atom while changing the total number of atoms

Quote from HaoYuan Wang on October 22, 2019, 3:49 amExcuse me, I have a problem and I need help. When I execute a xyz type file, the total number of atoms is changed, I want to change and fix the color of selected atom throughout all the process, as the picture shows. I tried to use the function of 'Manual selection' , it told me 'Stored selection state became invalid, because the number of input elements has changed'. Ask for help, thanks!
Excuse me, I have a problem and I need help. When I execute a xyz type file, the total number of atoms is changed, I want to change and fix the color of selected atom throughout all the process, as the picture shows. I tried to use the function of 'Manual selection' , it told me 'Stored selection state became invalid, because the number of input elements has changed'. Ask for help, thanks!
Uploaded files:
Quote from HaoYuan Wang on October 22, 2019, 3:51 amAs the number of atoms increases, the selected atom changes back to its original color.
As the number of atoms increases, the selected atom changes back to its original color.

Quote from Constanze Kalcher on October 22, 2019, 10:59 amHello HaoYuan,
I assume this is happening because you have no particle identifiers present in your input data. In that case the manual selection will use the particle indices instead and when the number of particle changes between frames it is not guaranteed that the same particles retain the same index (for your xyz-files).
In order to fix this you should add an extra column with the particle property "Particle Identifier" to the xyz-files. Note that OVITO can help you with that: Add a Compute property modifier to your pipeline, and edit the output property and expression fields as shown in the screenshot below.
After you have created the particle identifiers you can create the manual selection which will now remain active when jumping to a different frame.
Let me know if that works for you.-Constanze
Hello HaoYuan,
I assume this is happening because you have no particle identifiers present in your input data. In that case the manual selection will use the particle indices instead and when the number of particle changes between frames it is not guaranteed that the same particles retain the same index (for your xyz-files).
In order to fix this you should add an extra column with the particle property "Particle Identifier" to the xyz-files. Note that OVITO can help you with that: Add a Compute property modifier to your pipeline, and edit the output property and expression fields as shown in the screenshot below.
After you have created the particle identifiers you can create the manual selection which will now remain active when jumping to a different frame.
Let me know if that works for you.
-Constanze
Uploaded files:

Quote from HaoYuan Wang on October 22, 2019, 12:47 pmThank you for your prompt reply and help. I have got it. I have tried it, it is ok!
Thanks again!
Thank you for your prompt reply and help. I have got it. I have tried it, it is ok!
Thanks again!
新的OVITO微信频道!
New for our users in China: OVITO on WeChat
Official OVITO WeChat channel operated by Foshan Diesi Technology Co., Ltd.
