Mesh importing

Here, we import and render a mesh from an .obj file with a texture.

For importing other file types, see the Mesh class.

import blendersynth as bsyn
bsyn.run_this_script()

# Load a OBJ file
mesh = bsyn.Mesh.from_obj('../resources/monkeys/obj/monkey.obj')
bsyn.world.set_color((0.8, 0.7, 0.8))

bsyn.render.set_cycles_samples(10)
bsyn.render.set_resolution(256, 256)

camera = bsyn.Camera()
camera.set_fov(20)  # zoom in

# render
comp = bsyn.Compositor()
comp.define_output('Image', 'rgb')
comp.render().save_all('obj')