First, thanks for the work of weitang, this code is revised from https://github.com/WeiTang114/BlenderPhong.
A Blender python script to render an 3D model object by Phong Shading from several viewpoints. We currently support .obj, .stl, and .off files.
This is an output from airplane.off
:
We use blender-off-addon for off importing support.
Because the blender install path is various with different OS, you should assign the absolute install path for Blender in WIN10
<blender install path> phong.blend --background --python phong.py -- <model file> <output dir>
The followings are examples, you should change the absolute blender install path in win10.
Win10:
"C:\Program Files\Blender Foundation\Blender\blender.exe" phong.blend --background --python phong.py -- .\\single_off_samples\\airplane_0001.off .\\single_samples_MV
Ubuntu:
blender phong.blend --background --python phong.py -- ./single_off_samples/airplane_0001.off ./single_samples_MV
Win10:
"C:\Program Files\Blender Foundation\Blender\blender.exe" phong.blend --background --python phong.py -- dataset.txt .\dataset_samples_MV
Ubuntu:
blender phong.blend --background --python phong.py -- dataset.txt ./dataset_samples_MV