Change Physics Contact Pair Modes by code?

Is there a way to change Physics>Contact Pair Modes by code. My application needs to use “Default Contact Pairs” and “Enable All Contact Pairs” in differents scenes. I can’t figure how to access it.


This doesn’t look to be possible currently, not with separate physics scenes nor with Physics settings.

The simplest workaround would be to keep a static variable that states if such collisions are allowed, and for every collisions, check first if collisions are to be ignored, and if so, check that they are both static or kinematic. If they are, ignore the collision.