Skip to content

Latest commit

 

History

History
 
 

README.md

Instruction for Rendering using bpy

Installation

cd blender
# python 3.10 is necessary for blender 3.4 on which our scripts based
conda create -n blender python=3.10 -y 
conda activate blender
pip install bpy==3.4
pip install imageio
pip install tqdm
pip install imageio[ffmpeg]

Trajectory Preparation

To render a video for a targeted mesh mesh.ply, please first generate a trajectory containing a series of cameras around the mesh. After that, pack the intrinsics and extrinsics of each camera on the desired trajectory into dictionaries with following 4 keys: "image_height", "image_width", "world_view_transform" and "FoVx", and dump them into pickle files naming f{camera_index}.pkl. Then organize the data, making the folder look as follows:

data_path
        ├── mesh.ply
        └── traj
            ├── 00000.pkl
            ├── 00001.pkl
            ├── 00002.pkl
            └── ...

Rendering and Video Generation

Run

python render.py --load_dir <path to the mesh and trajectory data> --config_dir <path of the render config>

to render images and generate a video for the mesh and trajectory located at the load_dir. To render textured mesh, add the command line argument --is_texture.

Command Line Arguments for render.py

--load_dir

Path to the mesh and trajectory data (data_path in the above section).

--save_dir

Path where the rendered images and video should be stored (output/<random> by default).

--config_dir

Path where the render config file is stored. Set render_cfgs/dtu for DTU and render_cfgs/mip for mip.

--is_texture

The mesh file(.ply) generated by our method already contains texture. Use this argument to render textured images and video .

Video Generation Only

With images already rendered, run

python generate_video.py --load_dir <path to the rendered images>

to concatenate all of them into desired videos.

Useful Command Line Arguments

Debug Mode

You can specify command line arguments --debug_mode and --debug_video_step in render.py to render some images of a scene only, for quickly debugging.