[Bf-python] Fwd: Scene not changing in python script

Campbell Barton ideasman42 at gmail.com
Wed Sep 21 07:27:09 CEST 2011


The only reason you'd beed to switch to a scene to export it is if you
want to update it for animation - as in export info from multiple
frames, otherwise you can either pass the scene to one of you're
functions, or make a data context and pass that to the operator.

On Wed, Sep 21, 2011 at 6:54 AM, John Villar
<johnvillarzavatti at gmail.com> wrote:
> Hello everyone, i'm new on this list! I posted this as a bug on the blender
> tracker but Bastien pointed me here to see if this is a bad usage of the API
> issue.
> Currently i'm writing a blender exporter for JSON and my own binary version
> of JSON and i'm having a problem when switching scenes to export all my
> file's scenes. The fact is that i can't poll edit modes from objects that
> are on another scene besides the one currently selected on the editor.
> I have done this with the scene i want to export:
>     bpy.context.screen.scene = scene
>     bpy.context.screen.scene.update()
> But to no avail. Anyone has any idea what can i do to switch the scene via
> python? My exporter is here http://code.google.com/p/blender-machete/ feel
> free to grab the source.
> An here's a pae.st of the code http://pae.st/PdWF/ so you can edit it in
> there.
> John Villar
> Cell: (058)(416)926.86.45
>
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>
>



-- 
- Campbell



More information about the Bf-python mailing list