Skip to content

Instantly share code, notes, and snippets.

View HsiaTsing's full-sized avatar

Qing Xia HsiaTsing

View GitHub Profile
@HsiaTsing
HsiaTsing / ply2obj.py
Created October 30, 2014 02:47
This code use the Blender Python API to batch convert 3D model file with ''ply'' format to ''obj'' format. It is only tested on Blender 2.64.
import os
import bpy
# put the location to the folder where the plys are located here in this fashion
path_to_obj_dir = os.path.join('D:\\', 'Workspace\\Data\\scapecomp')
# get list of all files in directory
file_list = sorted(os.listdir(path_to_obj_dir))
# get a list of files ending in 'ply'
@HsiaTsing
HsiaTsing / obj2png.py
Created October 30, 2014 03:09
This code use the Blender Python API to batch render 3D model to image file. It is only tested on Blender 2.64.
import os
import bpy
# put the location to the folder where the objs are located here in this fashion
path_to_obj_dir = os.path.join('D:\\', 'Workspace\\Data\\scapecomp')
# get list of all files in directory
file_list = sorted(os.listdir(path_to_obj_dir))
# get a list of files ending in 'obj'