store vertex selection

I’m trying to store a selection of vertices in a way so I can retrieve it in multiple operators. The solution I’m thinking about is to use a PropertyGroup to store it. But my vertex selection variable doesn’t register for some reason.

I narrowed down the code of my add-on so you only see what’s relevant.
You can get it here.

The operator that uses the stored vertex selection can be accessed from an added button under Mesh Display, in Edit mode.
In this case the operator just deselects everything and should reselect the previous selection using the stored data (if only it worked).

this seem to select vertex in object mode
and I think it should be in edit mode !

did a quick test on your script
and I get an error of registration for the first class

register_class(cls)

ValueError: bpy_struct “MemorizeSelection” registration error: vertex_selection could not register

can you upload blend sample file with working script !

thanks
happy bl

The current working add-on doesn’t use a PropertyGroup nor store the selection data anywhere to be reused by multiple operators, so I’m not sure going through it will help you understand my PropertyGroup problem, but here it is anyway.

As you point out, some actions are performed in Object mode, but that’s normal. I first tried them in Edit mode and they didn’t work. Then I tried in Object mode and they did work. I don’t know why though.

As for the error message, it’s the same I have and that’s where I’m blocked. I don’t know what I’m doing wrong.

have not done a lot of things with the key things!
so hope somone else can help with that part
now you seem to be using the DATA values = old API method
so I think this is directly readable

I prefer to work with Bmesh data or Polygon
not certain the old API will be there in 2.8

I tried again your script
but now I get an error on registration for Main !

will test later on and be back if I find some thing

thanks
happy bl