Hi,
Did some searching but couldn’t find anything. Is there a way to globally turn “Chaos Cloth” on and off?
Thanks,
Simon
Hi,
Did some searching but couldn’t find anything. Is there a way to globally turn “Chaos Cloth” on and off?
Thanks,
Simon
Hello [mention removed]
Thank you for reaching out.
There is a “r.Mobile.EnableCloth” CVar that will disable cloth on mobile, but the tooltip alerts that it cannot be changed at runtime.
Please let me know if this is what you’re looking for.
All the best,
[mention removed]
Thank you.
That did it.
Appreciate the help.
Best,
Simon
Looking to be able turn off “cloth” when running on low end PC’s for instance.
If can’t fully turn off at least dial up / down the CPU usage depending on the settings.
Understanding what can and can’t do would be huge help
Thanks,
Simon
I found:
p.ClothPhysics
which seems like it can do what i need.
Hello [mention removed]
I’m glad you found that one.
Let me know if this solves your issue; otherwise, we can explore other possibilities.
All the best,
[mention removed]
Hi Rafael,
It works but need a global function if there is to reset all cloth to its bindpose.
Can i do that in a global call?
a “reset all”.
Hello [mention removed]
I’ve gathered a list of console commands you can try (p.CHaosCloth.Reset looks like the right thing to use):
`p.ClothPhysics 0|1
p.ChaosCloth.Reset
p.ChaosCloth.DebugStep [Pause|Step|Resume]
p.ChaosCloth.Solver.MaxVelocity 0|0.0001 (0 means “unlimited”) (0.0001 probably does not alleviate performance)
r.Mobile.EnableCloth 0|1`If you want individual control, check:
SkeletalMeshComponent->SuspendClothingSimulation() SkeletalMeshComponent->ResumeClothingSimulation() SkeletalMeshComponent->SetClothMaxDistanceScale() SkeletalMeshComponent->SetPhysicsBlendWeight() SkeletalMeshComponent->Set[Cloth Blend Weight] SkeletalMeshComponent->Set[Disable Cloth Simulation]
There was a talk yesterday on Unreal Fest about Cloth. They mention many strategies and optimizations. I recommend you check it out, a lot of valuable information there:
They mention Mobile Cloth and show some numbers:
[Image Removed]Let me know if this is helpful.
All the best,
[mention removed]
Hi,
Thanks for the link.
I’ve kind of got things working but have an issue see code below.
`void UP1GameInstance::P1SetClothSimulationState()
{
// Turn on/off the clothing solver.
if (P1ClothSimulationEnabled)
{
GEngine->Exec(GetWorld(), TEXT(“p.ClothPhysics 1”));
}
else
{
GEngine->Exec(GetWorld(), TEXT(“p.ClothPhysics 0”));
}
// Walk the skeletons and set disable cloth which will in turn set the skeleton cloth to bind pose.
for (TActorIterator It(GetWorld()); It; ++It)
{
AActor* Actor = *It;
USkeletalMeshComponent* skel = Actor->FindComponentByClass();
if (skel)
{
// Check to make sure actually doing cloth simulation.
if(skel->GetSkeletalMeshAsset()->HasActiveClothingAssets())
{
skel->bDisableClothSimulation = !P1ClothSimulationEnabled;
}
}
}
}`
The above code works pretty well except for one thing. If I load into a map with “p.ClothPhysics 0” doing “p.ClothPhysics 1” will not turn the cloth solver back on.
If its set to “1” when entering a map I can turn on and off as much as I want.
So how do i turn “on” whatever didn’t get initialized I’m guessing when the map loads? I looked through the engine but couldn’t find anything that jumped out at me as the issue.
Thanks,
Simon
‘p.ChaosCloth.Reset’ is classed as cheat and wont be around in shipping builds it seems. Also didn’t do anything when I tried using it.
Any update?
Hello [mention removed]
Sorry for the delayed response.
I was running some tests, and indeed, if you start with p.ClothPhysics 0, simply setting p.ClothPhysics 1 does not run the simulation.
I was able to enable it later by calling Recreate Clothing Actors on every affected Skeletal Mesh Component:
[Image Removed]Even if I start the simulation with the ClothPhysics disabled:
[Image Removed]Calling both p.ClothPhysics 1 and RecreateClothingActors enabled the simulation to run:
[Image Removed]Let me know if this is helpful.
All the best,
[mention removed]
Hello [mention removed]
I’m glad I could help.
If that’s all, I’ll close the case.
All the best,
[mention removed]