[Bf-python] Exporting multiple scenes

John Villar johnvillarzavatti at gmail.com
Fri Jan 27 16:54:49 CET 2012


Hello, everyone, i'm currently working on my own format's exporter, and
have been stumbling upon the same block for some months now (i asked here
about this some time ago but no response worked correctly).

My current exporter can succesfully export Single-scened files, multi-scene
files are a real problem, because i cannot enter edit mode of my
"non-current" scenes.

Namely, i iterate over each scene like this:

    arr_tmp = []
>
>     for sce in bpy.data.scenes:
>
>         bpy.context.screen.scene = sce
>
>
>>         if bpy.ops.screen.frame_jump.poll():
>
>             bpy.ops.screen.frame_jump()
>
>             arr_tmp.append(export_scene_json(sce, export_binary))
>
>         else:
>
>             raise Exception("Couldn't poll frame_jump")
>
>
And it works flawlessly, but then, inside "export_scene_json" when i
iterate over the objects an triangulate them, it cannot set the edit mode
of the objects because it cannot poll "bpy.ops.object.mode_set".

I suppose this is because it is the second scene and blender hasn't set the
current scene yet when i try to mode_set the objects.

Is there a way i can solve this? Does blender have a function like "wait
for the new scene to be settled" or something?

I'm pulling out my hair here so please, bear with me :(

John Villar
Cell: (058)(416)926.86.45
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20120127/4b700e09/attachment.html>


More information about the Bf-python mailing list