Fix T61567: Object loose its rigid body data when moving to collection

At some I unified the "move to collection" with the remove from all collections
functionality. That meant that even when we were still to keep the object in one
of the collections we would clear its rigid body data.

Now why to even remove the rigidbody data when removing an object from all
collections? That mimics the 2.79 behaviour when we were to unlink an
object from a scene. I suspect it has to do with the rigid body data
being tied to the scene rigid body. Which is a strange design anyways
(add to the list?) since an object can be in more than one scene.
This commit is contained in:
Dalai Felinto 2019-02-15 12:55:54 -02:00
parent 512bbf3748
commit f5ac1f444b
Notes: blender-bot 2023-02-14 06:57:56 +01:00
Referenced by issue #61567, Objects lose physics attributes on moving to a New Collection
1 changed files with 3 additions and 1 deletions

View File

@ -603,7 +603,9 @@ static bool scene_collections_object_remove(Main *bmain, Scene *scene, Object *o
{
bool removed = false;
BKE_scene_remove_rigidbody_object(bmain, scene, ob);
if (collection_skip == NULL) {
BKE_scene_remove_rigidbody_object(bmain, scene, ob);
}
FOREACH_SCENE_COLLECTION_BEGIN(scene, collection)
{