您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

带有命令行Blender参数的Python脚本

带有命令行Blender参数的Python脚本

我找到了最初需要的解决方案。

正如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

python 2022/1/1 18:35:05 有339人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶