Fix #109928: issues adding rigid bodies via just the world collection #109961

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:109928 into main 2023-07-11 12:22:51 +02:00

1 Commits

Author SHA1 Message Date
Philipp Oeser 31baa8d856 Fix #109928: issues adding rigid bodies via just the world collection
Selecting a rigid body world collection is supposed to set up rigid
bodies for all of its mesh members (if they are not rigid bodies
already), expected result would be just the same as if `Object` > `Rigid
Body` > `Add ...` was used.

Doing it via just the world collection had the following issues though:
- calculating mass would crash on such a freshly created rigid body
objects (be1b32e4e4 falsely assumed `ob->rigidbody_object` is always
present on evaluated objects -- without tagging for depsgraph updates
this is not the case though)
- rigid body simulation would not work even on these freshly created
rigid body objects

Now tag bmain relations and object transforms for update to make both of
these work (following code in `BKE_rigidbody_add_object` that is used
when adding these through `Object` > `Rigid Body` > `Add ...`)
2023-07-11 10:57:50 +02:00