I am not a big blender user, but I want to use it for 3D-visualization purposes.
I am trying to run the following script
import bpy scenes=['file01.blend','file02.blend'] for i in steps: frame_num = i for s in scenes: bpy.ops.wm.open_mainfile(filepath=s) my_obj = bpy.data.objects['MyObj'] for x in bpy.data.objects: x.select=False my_obj.select=True scn = bpy.data.scenes scn.objects.active=my_obj bpy.ops.object.shade_smooth() scn.frame_current=frame_num bpy.ops.render.render(write_still=True)
I need to run it in background mode, but it will always crash when using function like bpy.ops.object.shade_smooth() because of incorrect context.
Is there a way to apply such operators in background mode? Any workaround?
The point is that I absolutely need to re-open the blend file because each frame involves hundred of megabytes of data and this is (as far as I understand) the only way to free memory in blender.
Thanks a lot