If creating a basic operator and reading the list of selected objects upon execute I get the correct response:
class foo(bpy.types.Operator):
bl_label = "foo"
bl_idname = "foo"
def execute(self, context):
print(context.selected_objects)
return {'FINISHED'}
However I need to read the list of selected objects elsewhere, outside of the Operator, from within a subclass of threading.Thread.
Calling bpy.context.selected_objects anywhere else results in an error, as it doesn't exist.. which is both puzzling and irritating.
Has anyone else dealt with situation before, not being able to access the list of selected objects. Is there by chance another method?
I have thought about creating an operator that would return the list of selected objects if invoked through python code... but I do not understand operators fully (yet) and thus do not know if that is possible.