Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-07-16 17:04:22 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-07-16 17:08:32 +0300
commit105ae3be9993a646615499bf793cb14549e4104d (patch)
treeb21dc56f3ae11611a3f7e93007e831f976dca62e /source/blender/blenkernel/intern/collection.c
parente6e69a28ab28631b2b1b99f55fb618459e7671ad (diff)
Fix T66944: Rigid Body Constraint in duplicated collection is not added to RigidBodyConstraints collection.
We only had a very limited, specific handling of that in collection duplication code, but this has to be handled at a much more general level in Object copy code itself, since it makes no sense to duplicate rigidbody object data without adding new copy to relevant rigidbody collections... WARNING: This is a fairly risky rework of rigidbody handling logic when copying an Object data-block. It is *NOT* considered safe enough for 2.80 release. I tried to take into account copy flags to not mess with other IDs (collections) when we are copying outside of Main, and also not do deg tags when this is forbidden, but risk of something going wrong here is too high...
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r--source/blender/blenkernel/intern/collection.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index ac55846714b..965f6e4bc51 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -287,16 +287,6 @@ static Collection *collection_duplicate_recursive(Main *bmain,
collection_object_add(bmain, collection_new, ob_new, 0, true);
collection_object_remove(bmain, collection_new, ob_old, false);
-
- if (ob_new->rigidbody_object != NULL) {
- BLI_assert(ob_old->rigidbody_object != NULL);
- for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) {
- if (scene->rigidbody_world != NULL &&
- BKE_collection_has_object(scene->rigidbody_world->group, ob_old)) {
- collection_object_add(bmain, scene->rigidbody_world->group, ob_new, 0, true);
- }
- }
- }
}
}
@@ -572,7 +562,7 @@ bool BKE_collection_object_cyclic_check(Main *bmain, Object *object, Collection
/******************* Collection Object Membership *******************/
-bool BKE_collection_has_object(Collection *collection, Object *ob)
+bool BKE_collection_has_object(Collection *collection, const Object *ob)
{
if (ELEM(NULL, collection, ob)) {
return false;