我找到了最初需要的解决方案。
正如Junuxx所说的:“在 这种情况下, 您不能直接将命令行参数传递给python …”,但实际上,在另一种情况下,您可以将参数传递给python。
所以做我想要的方法是渲染并直接保存在python脚本中
import sys
fov = float(sys.argv[-1])
...
# Set Scenes camera and output filename
bpy.data.scenes["Scene"].render.file_format = 'PNG'
bpy.data.scenes["Scene"].render.filepath = '//out'
# Render Scene and store the scene
bpy.ops.render.render( write_still=True )
--python选项(或-P)必须位于末尾,并且可以使用-指定参数,然后只需加载模型并运行脚本即可。
> blender -b "demo.blend" -P script.py -- 50
归功于我发现的这个链接:http ://www.blender.org/forum/viewtopic.PHP?t=19102&highlight=batch+render