Fix (unreported) Broken rigidbody requirements when adding objects to a RB collection.
[blender.git] / source / blender / blenkernel / intern / collection.c
index 9b68c61e016507f55ca53b5f3c34b7538d4b2dee..33287d5a2f8a0765617b0fb2aa506dc45cfa7987 100644 (file)
@@ -42,6 +42,7 @@
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_object.h"
+#include "BKE_rigidbody.h"
 #include "BKE_scene.h"
 
 #include "DNA_ID.h"
@@ -515,6 +516,10 @@ static bool collection_object_add(Main *bmain, Collection *collection, Object *o
                DEG_id_tag_update_ex(bmain, &collection->id, ID_RECALC_COPY_ON_WRITE);
        }
 
+       if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) {
+               BKE_rigidbody_main_collection_object_add(bmain, collection, ob);
+       }
+
        return true;
 }