私はblenderとpythonを初めて使用します。各画像にいくつかのプロパティを提供するいくつかの画像としてバッチレンダリングしたいブレンダーモデル(.blend)があります。
これらのパラメータを使用して、次のようなPythonスクリプトを作成しました。
import bpy
pi = 3.14159265
fov = 50
scene = bpy.data.scenes["Scene"]
# Set render resolution
scene.render.resolution_x = 480
scene.render.resolution_y = 359
# Set camera fov in degrees
scene.camera.data.angle = fov*(pi/180.0)
# Set camera rotation in euler angles
scene.camera.rotation_mode = 'XYZ'
scene.camera.rotation_euler[0] = 0.0*(pi/180.0)
scene.camera.rotation_euler[1] = 0.0*(pi/180.0)
scene.camera.rotation_euler[2] = -30.0*(pi/180.0)
# Set camera translation
scene.camera.location.x = 0.0
scene.camera.location.y = 0.0
scene.camera.location.z = 80.0
だから私はそれを次のように実行します
blender -b marker_a4.blend --python "marker_a4.py" -o //out -F JPEG -x 1 -f 1
次に、たとえば、Pythonスクリプトへの引数を使用しようとすると
...
import sys
...
fov = float(sys.argv[5])
...
そしてそれを実行します:
blender -b marker_a4.blend --python "marker_a4.py" 80.0 -o //out -F JPEG -x 1 -f 1
レンダリングは完了しましたが、開始時にこのメッセージが表示されます。
read blend: /home/roho/workspace/encuadro/renders/marker/model/marker_a4.blend
read blend: /home/roho/workspace/encuadro/renders/marker/model/80.0
Unable to open "/home/roho/workspace/encuadro/renders/marker/model/80.0": No such file or directory.
...
誰かがこれを引き起こしているものを教えてもらえますか?ブレンダーもそれをモデルとして解析していると思いますが、その理由はわかりません。後で、Python(argparse)での引数の解析のためにもっと洗練されたものを試しましたが、まったく機能しませんでした。ですから、このレベルで何か奇妙なことが起こっているのではないかと思います。
ありがとう!