dynamically turn on off allowSleep?

Is it possible to dynamically change whether a shape is allowed to sleep?

In my game a body can be picked up by player avatars. At this point the body becomes a sensor.
A player should only be able to drop the body when it's not overlapping with any other object (other player, terrain, etc.)

I've got this working, but it forced me to put allowSleep to false. Else when two picked up (sensor) bodies would go to sleep they could be dropped overlapping each other because it no longer checked for collisions.

It would be preferable to toggle the allowance for sleep when the body is picked up so they can still sleep when on the floor far away from the camera.
I'm not sure I completely understand what you are doing since a sleeping dynamic body won't move... but why don't you just call wakeup() prior to dropping and check for a collision first?

Original thread: https://box2d.org/forum/viewtopic.php?t=3036