[Bf-committers] Change scene by python API

revuedelibre . revuedelibre at gmail.com
Wed Mar 23 08:28:16 CET 2011


Hello,

Is there a solution to change Scene by python API ?

I found that we can change it by screen.scene = bpy.data.scene['NewScene'].

Juste after that, bpy.ops.mesh.primitive_cube_add() have does :

- add a cube in the new selected scene when these 2 actions are done step by
step in python console
- add a cube in previous selected scene when these 2 actions are in a
script.

--> Strange to have a difference in these 2 actions


And what about background mode ( not tested ) ? It's quite strange to use
"screen" for change scene in background mode ( no screen ! )

Thanks & Regards,

Ju


More information about the Bf-committers mailing list