I have code to make a copy of my scene.
bpy.ops.scene.new(type='FULL_COPY') cloneScene = bpy.context.scene cloneScene.name = 'clone'
I wish to adapt it so that if the .blend contain several scenes, it will make a copy of the scene named 'Scene', i.e. The default scene (in my use case, it is reasonable to suppose this exists).
First thought is to do:
bpy.context.scene = bpy.data.scenes[ 'Scene' ]
Doc on bpy.context here http://www.blender.org/documentation/blender_python_api_2_57_release/bpy.context.html says 'Note that all context values are readonly, but may be modified through the data api or by running operators'
So I assume I cannot do this.
I found a related thread: http://blenderartists.org/forum/archive/index.php/t-201501.html
bpy.data.screens['Default'].scene = bpy.data.scenes['Scene'] bpy.context.screen.scene=bpy.data.scenes['Scene']
But I don't understand what's going on here, so I'm hesitant to blindly copy the code across. Does each sub-window have an associated screen, so my 3-D view could be viewing one scene whereas the animation view could be looking at another?