This has been driving me crazy for some time, because it seems so simple, but I just cannot find a way to do it despite exhaustive searching. Say I'm in bmesh, and I create a vertex, and I add it to the mesh. For whatever reason, this vertex is special. I need to be able to access this vertex again. Not just later in the same script, but between sessions.
Things I've tried and why I can't make them work:
- Obviously, I can just go for the index of the BMVert, but those change all the time when other vertices get deleted, so this value isn't useful to me.
- I thought of storing the actual reference to the BMVert Python object, but I don't really understand how this could really persist between sessions, because besides the fact in new sessions those same objects (from Python's perspective) no longer exist, the only storage place I know of that persists on an object is custom properties, and in there you can only store basic types like strings and numbers.
So, I need a way, ideally in text or numerical form, to permanently and uniquely address a vertex, and it should be one I can access in an indexed way, because the shapes I'm dealing with have too many vertices to do this by search. It just feels so viscerally simple to me, and it's been a major stumbling block for me for a while now that I just can't figure out how to do it.
Any help would be immensely appreciated.