diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-12-12 17:05:19 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-12-12 17:05:19 +0300 |
commit | 62703850ad560b5832c4e42143f563d11ba21cf4 (patch) | |
tree | a1a48b6867eaa32740b82ea20653f1c59a8c3168 /source/blender/blenkernel/intern | |
parent | b708dce34f8caa52efba7ddf7ed00582a36e38f9 (diff) |
Cleanup: Get rid of unused BKE_rigidbody_relink_constraint().
Also use proper ID_NEW_REMAP macro in BKE_rigidbody_world_groups_relink()!
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/rigidbody.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 628222ed306..747f5775aff 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -46,6 +46,7 @@ # include "RBI_api.h" #endif +#include "DNA_ID.h" #include "DNA_group_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" @@ -222,13 +223,6 @@ RigidBodyCon *BKE_rigidbody_copy_constraint(Object *ob) return rbcN; } -/* preserve relationships between constraints and rigid bodies after duplication */ -void BKE_rigidbody_relink_constraint(RigidBodyCon *rbc) -{ - ID_NEW_REMAP(rbc->ob1); - ID_NEW_REMAP(rbc->ob2); -} - /* ************************************** */ /* Setup Utilities - Validate Sim Instances */ @@ -973,12 +967,9 @@ RigidBodyWorld *BKE_rigidbody_world_copy(RigidBodyWorld *rbw) void BKE_rigidbody_world_groups_relink(RigidBodyWorld *rbw) { - if (rbw->group && rbw->group->id.newid) - rbw->group = (Group *)rbw->group->id.newid; - if (rbw->constraints && rbw->constraints->id.newid) - rbw->constraints = (Group *)rbw->constraints->id.newid; - if (rbw->effector_weights->group && rbw->effector_weights->group->id.newid) - rbw->effector_weights->group = (Group *)rbw->effector_weights->group->id.newid; + ID_NEW_REMAP(rbw->group); + ID_NEW_REMAP(rbw->constraints); + ID_NEW_REMAP(rbw->effector_weights->group); } void BKE_rigidbody_world_id_loop(RigidBodyWorld *rbw, RigidbodyWorldIDFunc func, void *userdata) |