I would like to set the active scene with bpy.context.window.scene = my_scene
Now the problem is that normally this works if you are in the right context, the problem (in my specific case) is inside a function that is executed immediately after
immediately after the end of the render I get:
for s in bpy.data.scenes: if s == my_scene: context.window.scene = s
AttributeError: 'NoneType' object has no attribute 'scene'
so I guess currently the context has changed to that of rendering, am I wrong?
How can I solve this?