I'm using Blender 2.76b, threejs exporter v1.5.0; my goal is to export each mesh in the Blender scene. I noticed that if a single mesh is selected, io_three exports that mesh, so I wrote a simple python script executable in console:
import bpy
for ob in bpy.context.scene.objects:
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_pattern(pattern = ob.name)
bpy.ops.export.three(
filepath = 'path to folder' + ob.name + ".json",
option_vertices=True,
option_faces=True,
option_normals=True,
option_uv_coords=True,
option_face_materials=True,
option_colors=True)
It creates files with right names, but with wrong content: all the .json files contain exported content of the scene's first mesh.
How could I get the right behavior? Thanks in advance.