Cloth simulation holds on to skinning information

Hello,

I’ve had this problem in 4.24, made a bug report, got the answer that in 4.25 it seems the “bug” doesn’t exist anymore. I’m not sure, and wasn’t from the beginning that it’s a bug. If it is, then fine, I’ll wait patiently for a fix, however, I want to make sure it is and it’s not me missing something.

The problem: I’m cloth-painting parts of a SKM. Everything looks as I wan it in persona. I try various animations and they all look as I want them to. However, in the viewport/in game/at runtime, simulated areas behave as they would have a cloth blend weight of 0.5 or so (and awkwardly stretched, glitchy), when in fact, the blend weight is 1, therefore full simulation, no skinning.

Vid with the problem: ClothSimProblem

Tried so far:

  • With/Without Physics Asset, checked material (the mesh has thickness, so no two-sided needed)
  • Tried many meshes
  • Various cloth paint values
  • Re-imported mesh in clean, empty project with all default settings
    Exactly the same behavior, no matter what I do.

Can anyone confirm if it’s a bug indeed or there is something wrong with my content/settings. I’ve looked everywhere and tried everything to my knowledge.

Thanks!

In 4.24 there have been few bugs with cloth which were fixed in 4.25. Unfortunately, what you are seeing is not one of those.

Basically, whenever you have animation and cloth simulation kicks in, cloth asset will use current skinned pose (with all the deformations from animation) as a base pose for simulation, which usually leads to this kind of stretched cloth problems. You can try to replicate the same problem in persona by running animation and using Ctrl + Alt + C (reset cloth). If the same problem occurs then you know what you are dealing with.

If you start simulation from the rest pose it should match to the one in persona in your video. Another way is to skin your clothes to one bone per part (so no deformation on cloth happen), but this may lead to problems like penetration and etc.

Did you manage to fix this problem at all? I’m having the same situation, where persona cloth looks perfect, but in viewport/game itš completely broken and unusable.

Thanks for the info, that cleared the fog by quite a lot! The question is: how do I start sim from base pose in gameplay/runtime scenarios? Is it possible? If it is and you know a method, I would very much appreciate if you could share it :slight_smile: Thanks!

I’ve been in contact with support for quite some time, they were very open and eager to help. In my last conversation with them, they said the problem seems to be fixed in their “internal build”. This was about two weeks ago, so I’m assuming their internal build is 4.26 or something.
Other than that, there’s nothing else to do. It’s an engine bug, there’s nothing we can do about it.

Okay, I see. Thank you for the reply. I guess we’ll have to wait :slight_smile:

I’m currently battling this problem as well. I have a run cycle, and every time the cycle repeats, the character’s cape resets to the T-pose (straight out) position and simulates from there. As the cycle is only a few frames long, you can imagine this looks very silly and pops like crazy.

Hi, sorry for the delay.
We managed to overcome this by pre-spawning characters in reference pose and then blend them into animation. Some characters were refactored to use bone based dynamics or only one bone for cloth.

This sounds like a different issue for me.
I wonder why would cloth reset on an animation cycle. Do you have ‘reset cloth’ anim notify in animation sequence asset?

I see…my setup won’t allow that, especially since I’m way too far into development to re-make the whole spawn chain. With testing and newly introduced bugs (as I’m sure you know happens), it might delay me for 1-2 months.
But it’s something I’ll keep in mind and maybe even implement in some parts of the game, to see how/if it works. Thanks for the idea! :slight_smile:

I have the same exact issue in 4.25. Cloth performs correctly in preview for colliders and for the model, as well as individual animations + blend space. However, in character blueprint preview + actual game it is incorrect, blended between skin and cloth.

Hello! I think I’m facing the same issue even though it’s been 2 years. I’m using UE 4.27 and the simulation looks fine in preview, but the cloth stretches weirdly at runtime. It also happens if I reset the cloth simulation in preview.

If this is a bug, is it supposed to be fixed in newer engine versions? If not, does anyone know what is causing it? Thank you!

They arent touching nvcloth or physx.
If you want it fixed grab the latest source for .27, replace physx files with the latest and compile. Its marginally better.

The cloth implementstion in engine is however ■■■■. It has always been because whoever implemented it knowingly did not follow Nvidia’s documentation on the sdk.

For instance Backstop doesn’t really work.
There are a few other issues as well, though not as huge or problematic.

You can hope they made a better job with chaos, but I realistically doubt it.

As far as the rest of the topic before your resurrection, cloth always follows skinning. The simulation and values you set are simply how much distance a specific vertex can diverge from the location of where it is supposed to be according to the skinning. To be more precise the value is a radius from the skinned position.
Read this if interesead in understanging how it works:
https://gameworksdocs.nvidia.com/PhysX/3.4/PhysXGuide/Manual/Cloth.html