When running my bpy script from command line with the argument -b (background mode) I get a different size of the image vector I want to render than without the argument. Did somebody encounter the same problem already? For better explanation here is the code:
scn.render.resolution_percentage = 100 scene.use_nodes = True tree = scene.node_tree links = tree.links # create input render layer node rl = tree.nodes.new('CompositorNodeRLayers') # create output node v = tree.nodes.new('CompositorNodeViewer') v.use_alpha = False # Links links.new(rl.outputs['Z'], v.inputs) # link Z to output scn.render.image_settings.color_mode = 'BW' bpy.ops.render.render() # get viewer pixels pixels = bpy.data.images['Viewer Node'].pixels
Render settings are 520x424 pixels defined in the blend file. in the command line I use the following cmd:
blender -b ...\Blender_Animation1.blend --python ...main.py
when I check the variable pixels i get different lengths depending whether I use the b or not. Without b I get 881920 values ( 1 pixel = RGBA -> 520*424*4 = 881920) which is correct. In the other case I get much less. Did somebody have the same problem already and knows what causes this error?