Q&A Explanation #454
Replies: 4 comments 19 replies
-
I'm really new to BlenderProc, and I found it to be an amazing tool. One thing I'm curious is that, can I add Human objects into the scene and can I manipulate the Human object in a natural way? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hey, is it possible to reuse convex_decompositions objects in the scene instead of reloading it each time it is used ? convex decomposition is done only once - thats fine! For example i have 10 times the same object with different position and orientation in my scene. Currently loading the convex_decomposition from folder is done for every 10 objects, which takes some time. For loading the objects themselfs i use the cached_objects variable (ObjectLoader.load_obj()) which works fine. When calling build_convex_decomposition_collision_shape(vhac_pathvariable) all i pass to function is the vhac_path. The cache_dir has the default value. Is there a way to write the convex_decomposition into the cached_objects dict or any other way to prevent reloading the same convex_decompositions into the scene? Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hey Max, I'm trying to simulate various camera poses and light settings using blenderproc. So far I can change the camera poses, but when I try to change the lights all scenes seems to get the last light value that is geenrated in the loop. My code looks something like this: light = createLight(sourceType=LightSource.SUN)
def changeCameraPose(camera, cameraPose):
print("Changing camera pose:")
rotation = [cameraPose['rot'][0], cameraPose['rot'][1], cameraPose['rot'][2](*rotationValues[camera])]
matrix_world = bproc.math.build_transformation_mat(cameraPose['pos'], rotation)
bproc.camera.add_camera_pose(matrix_world)
def changeLightSettings(light):
# Setting random light poses
light.set_rotation_euler([round(random.uniform(4.3, 5.8), 1),
round(random.uniform(-1.3, 2.8), 1),
round(random.uniform(-0.5, 0.5), 1)],
)
energy = random.uniform(-20, 200)
print(f"Light energy: {energy}")
light.set_energy(energy)
def main():
for j in range(settings.numOfRenders):
# Changing light and camera poses
for camera, cameraPose in enumerate(cameraPoses.values()):
print(f"Generating images for camera: {camera + 1}/{len(cameraPoses)}")
# Modify camera and light - cameraPos is a dict, with keys: pos and rot
changeCameraPose(camera, cameraPose)
changeLightSettings(light)
data = bproc.renderer.render() How should I apply different light to the sceens? I have already looked at the examples, but I can't find pointers on how to do this? |
Beta Was this translation helpful? Give feedback.
-
Hey,
we are happy that you use BlenderProc and that you stumbled upon this Q&A section. You can always ask a question here and see if someone can help you.
But, before you ask your question make sure that you checked the documentation and all answered questions if your question was already answered before.
Best,
Max
Beta Was this translation helpful? Give feedback.
All reactions