Save array of Ints by object on UI list item

Hello,

I’m writing an addon to save selected vertices (like Quick Select List on Maya), but I’m facing a problem and couldn’t find anything about it after searching on Google and this forum. This is my first addon and I have some knowledge about python.

The problem is that I need to find the correct way to save multiple arrays of integers by object, I’m not sure if I have to use a PropertyGroups because couldn’t find the appropriate one for this scenario, so I try registering an array variable in the Object type… it works; the vertices are saved for each list item but globally (for all mesh objects), does not apply only to selected object; if I select another object and create a new one list item of this object (without assigning vertices), this one has the same array of vertex that was previously assigned to the first object:

bpy.types.Object.qss_vertices = []

I already have an UIList (like Vertex Groups) that is already working for each object so I suppose that I should link that array(s) with the list item but I need a guide to do this. :o

This GIF shows how is already working

PD: Vertex Groups is not the same because if the mesh is modified new vertices are added to the already saved group.

Thanks in advance!

Have you tried storing them in hidden string properties? Assigned to each item in list.

@Albertofx I tried and it works. Thank you!

I just wonder if this is the right way to do it, there is no a way to keep it as an array and not as a string?

I upload the addon on github: https://github.com/sliker/blender-quick-select-set

Thanks!