I'm trying to understand how selections and active objects work within a context. I thought I understood that a selection is part of a context. I read somewhere that you can create a copy of a context (context.copy()) in order to avoid changing the user's actual selections.
Some code I've seen fits this concept, such as..
context['selected_objects'] = list
context['active_object'] = object
But other code I've seen does not, such as..
object.select = False
Would anyone be able to help me understand what's happening behind the scenes? I can't imagine how
object.select = False can be triggering any state changes inside of a context? Perhaps objects have their own selection states, but they can be overridden by a context? Or maybe the things I read were completely wrong?
Edit: It appears that part of my issue is that Blender keeps changing the syntax and setup of how selections work. It looks like they are now part of the view layer. But if I make a copy of the context, Blender reports that it doesn't even have a view layer. Does anyone know how to properly copy the context and select/activate objects with the copy?