まぐちゃん 2022/10/25 11:13

Blenderでスクリプト一発でVR出力用の設定を構築【Python】

Blenderでスクリプト一発でVR出力用の設定を構築【Python】


import bpy
bpy.context.object.data.type = 'PANO'
bpy.context.object.data.cycles.panorama_type = 'EQUIRECTANGULAR'
bpy.context.object.data.cycles.longitude_min = -1.5708
bpy.context.object.data.cycles.longitude_max = 1.5708
for scene in bpy.data.scenes:
    scene.render.engine = 'CYCLES'
    scene.cycles.use_denoising = True
    scene.render.resolution_x = 1920
    scene.render.resolution_y = 1920
    scene.render.use_multiview = True
    scene.render.image_settings.views_format = 'STEREO_3D'
    scene.render.use_multiview = True
    scene.render.image_settings.stereo_3d_format.display_mode = 'SIDEBYSIDE'

Blender2.93で確認、たぶん2.79以下だと動かないです
レンダリングに使用するカメラを選択した状態でコマンドラインにコピペして実行
構築されるのは180度のサイドバイサイドの設定
360度の場合は経度を最小-180、最大180にすれば360度で出力できます。(いずれは180度と360度を切り分けられるようにボタン化したい)
1920は解像度で、この設定だと3840×1920の4Kサイズで出力されます。
1000とかに変更すれば2000×1000に
どの解像度でも、正方形にするために同じ値にすることを忘れないように
とりあえず忘備のためにメモ(よくスクリプトの保存場所を忘れる)

この記事が良かったらチップを贈って支援しましょう!

チップを贈るにはユーザー登録が必要です。チップについてはこちら

月別アーカイブ

記事を検索