My problem is as follows: I'm working on a script that renders all the scenes in a file (matching some criteria, in this case having a default Camera on Layer 0).
But I cannot make a Render option based on this.
The (bad) code is as follows
import bpy class LoopRenderEngine(bpy.types.RenderEngine): bl_idname = 'loop_renderer' bl_label = 'Loop Renderer' def render(self, scene): #bpy.context.scene.render.engine = 'BLENDER_RENDER' bpy.ops.render.render() bpy.utils.register_class(LoopRenderEngine)
Since this calls the
render() function in when implementing the
render() function, it's not a surprise that this doesn't work.
Switching back as mentioned above to the
BLENER_RENDER engine didn't work.
Any idea how to render within the render function?
PS Here is the whole code to understand my intentions better.
import bpy import time class LoopRenderEngine(bpy.types.RenderEngine): bl_idname = 'loop_renderer' bl_label = 'Loop Render Test' bl_use_preview = True def render(self, scene): bpy.context.scene.render.engine='BLENDER_RENDER' bpy.ops.render.render() bpy.utils.register_class(LoopRenderEngine)
This works (ie starts rendering), but crashes when rendering. The command line shows: