Keep USkeletalMeshComponent from falling asleep in C++ without WakeAllRigidBodies()

How can I keep a Skeletal Mesh Component from falling asleep in C++ without calling WakeAllRigidBodies() every frame? I want to configure the skeletal mesh before it starts ticking so I don’t have to tell it NOT to do something every frame, which is silly. I know how to do this from the editor, which is to go into the SMC’s physics asset, select all bodies, then set sleep family to custom and custom sleep threshold multiplier to 0.

I’ve tried this code…

UPhysicsAsset* upa;
if (PhysicsAssetOverride == nullptr) {
  upa = GetPhysicsAsset();
}
else {
  upa = PhysicsAssetOverride;
}
for (auto sbs : upa->SkeletalBodySetups) {
  sbs->DefaultInstance.SleepFamily = ESleepFamily::Custom;
  sbs->DefaultInstance.CustomSleepThresholdMultiplier = 0.f;
}

but it doesn’t do what I need. It does not prevent the SMC from sleeping, but it does modify the values of the sleep family and threshold in the physics asset in the editor. I’ve also tried the following which didn’t seem to work either:

UPhysicsAsset* upa;
if (PhysicsAssetOverride == nullptr) {
  upa = GetPhysicsAsset();
}
else {
  upa = PhysicsAssetOverride;
}
TArray<FName> bone_names;
GetBoneNames(bone_names);
if (bone_names.Num() > 0) {
  for (const auto& name : bone_names) {
    FBodyInstance* fbi = GetBodyInstance(name);
    if (fbi != nullptr) {
      fbi->SleepFamily = ESleepFamily::Custom;
      fbi->CustomSleepThresholdMultiplier = 0.f;
    }
  }
}

I’d prefer a solution that doesn’t require adding the PhysX module as a dependency to my plugin I’m making.

Even the answer, “It’s not possible, sorry” would be acceptable here.

I have a daily reminder to bump this thread. I have to keep pressing this question as long as it remains a task for me in my company’s project tracking system.

Bump, post is nearly a month old.

Daily bump.

A bump a day, keeps the fear of not getting my question answered away.

Bumpty Dumpty sat on a wall…

My PM knows about the thread now, bumps are even more essential. Bump.

Would you like one bump or two?

Do the Bumpty Bump, come on and do the Bumpty Bump

Bumpedict Bumperbatch

Bumpthony Threadtano

Happy 6 weeks!

Hi-diddly-ho bumperino!

President Bump

Holy bumps-going-unnoticed, Batman!

At this point I think I’m just watching the post’s views slowly climb up.

The thread goes oooon and ooooon and oooooon and ooooOOooOOoOon!

Help Epic wan kenobi, you’re my only hope!

M-m-m-monster thread!