Page 1 of 1

Parenting cameras to soft body?

Posted: Thu Nov 10, 2016 11:04 am
by FilippS
How can you parent a camera (or any rigid object) to a soft body?
Parenting seems to work only for rigid objects, is there a workaround for soft bodies?

Re: Parenting cameras to soft body?

Posted: Thu Nov 10, 2016 2:56 pm
by tsn
Hi FilippS,

By default that's not possible, because the position of deformable objects is calculated in a different way. When you look at the soft body's position values during simulation you will see that the XYZ remain constant.

The only workaround is a script. The script calculates the soft body's centre of gravity by using the body's vertex positions. The centre of gravity is than transferred to a Null object's position, while the camera itself is parented to the Null. I've attached an example scene for you. To see the script press Ctrl/Cmd + 2 (Simulation Flow) and take a look at the script in the "FramesPost" section. All you have to change is the name of the object you want the camera to follow.
camera_follows_softbody.zip
Cheers,
Thomas

Re: Parenting cameras to soft body?

Posted: Fri Nov 11, 2016 1:46 pm
by FilippS
Great, this works perfect - thank you!

Re: Parenting cameras to soft body?

Posted: Tue Feb 28, 2017 2:21 pm
by hmercado
Hi,
Could you please post the scene or the script for the Learning Edition?

Thanks

Re: Parenting cameras to soft body?

Posted: Tue Feb 28, 2017 10:22 pm
by Alex
This one should work: