Skip to content

Commit

Permalink
Merge pull request DLR-RM#474 from DLR-RM/iss_427_add_quickstart
Browse files Browse the repository at this point in the history
Fix(quickstart.py): Actually add the script
  • Loading branch information
MartinSmeyer authored Feb 9, 2022
2 parents 0f86cb2 + 8aba380 commit 550faeb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions blenderproc/scripts/quickstart.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import blenderproc as bproc
import numpy as np

bproc.init()

# Create a simple object:
obj = bproc.object.create_primitive("MONKEY")

# Create a point light next to it
light = bproc.types.Light()
light.set_location([2, -2, 0])
light.set_energy(300)

# Set the camera to be in front of the object
cam_pose = bproc.math.build_transformation_mat([0, -5, 0], [np.pi / 2, 0, 0])
bproc.camera.add_camera_pose(cam_pose)

# Render the scene
data = bproc.renderer.render()

# Write the rendering into an hdf5 file
bproc.writer.write_hdf5("output/", data)

0 comments on commit 550faeb

Please sign in to comment.