Open ErikDerGute opened 9 months ago
Edit: Maybe I forgot to mention that also with the param "objects_to_check_collisions" set to the child objects it doesn't work.
I also met this problem. Hi, have you figured out the solution? Thanks!
Hi, unfortunately not really, but there's a quick and dirty workaround. As the child objects are paired to the corresponding parent object, there is no need to set the location separately. My workaround was to simply skip the child objects inside the function. In my case I know the names of my child objects, so is just customized the function like:
for obj in objects_to_sample:
if 'kp' in obj.get_name():
continue
# Store the obejct's initial pose in case we need to place it back
if mode_on_failure == 'initial_pose':
initial_location = obj.get_location()
initial_rotation = obj.get_rotation_euler()
in ObjectPoseSample.py
line 54. If you don't know your child object names, it should also be possible to do something like:
if obj is "child object" -> continue
.
Hope this is useful for you.
Hey @ErikDerGute,
I think the main problem at least with the example you gave in your initial post is that you are using objects with no volume (the circle) which are not supported by blenders collision check.
If the circle should not take part in the collision checks at all, then I recommend to remove it from the objects_to_sample
and also the objects_to_check_collisions
parameter.
Thanks for your reply. As I said in my previous edit I removed the child objects from the objects_to_check_collisions
and also only sample the parent objects. Maybe I did something wrong back then. Regardless of this it's not a problem for me anymore.
Describe the issue
Hello guys,
i would like to use the bproc.object.sample_poses() function to arrange my objects without collisions to run the physics simulation afterwards. When ich use my "default" objects everything works fine. As soon as i add to an object a child object an error occurs. Some models for example are in the .zip archive, because git don't support .blend files.
The error:
Thanks!
Minimal code example
Files required to run the code
Archiv.zip
Expected behavior
Place the objects without collision.
BlenderProc version
2.7.0