I’m fairly new to the Blender API so forgive me if I am missing something obvious.
My problem is like so: I have multiple objects that I want to reference in code for later.
As an example, say I want to make a list that stores every selected object so I’ll create a list using
my list = bpy.context.selected_objects
This usually works fine up until Undo causes invalidation.
The only solution I can think of right now is to find the objects again through their names using a for loop and
bpy.data.objects.get("Suzanne") but this is less than ideal.
What if the user changes the name?
Sadly, this makes using this option unusable for the addon I want to create.
My question is: what is the best / most correct way of handling a situation like this?