Home Unreal Engine

UE4 Apex Clothing Sim not working

null
Hello All,

I'm currently experimenting with Apex Clothing simulation for UE4 and at present, it's totally broken and I have no idea why.

To preface this, I want to say that I've used Apex before, 2 years ago, in a little scene I made so I could have a flag blowing in the wind. It worked back then without any trouble at all, but ever since I've never managed to get it to work as intended.

The scene I'm currently building has a clothing line with some clothes hung on it, I want to get them to blow around a little.

I started by making the worlds worst pair of trousers along with a simple rig:


Courtesy Warning: I've only got a little bit of experience with rigging/skinning so if you suspect that may be the cause of the problem, please let me know.

After doing that, I applied the physx clothing modifier and set up the max distance with some simple values. (10, 20, 30, 40 descending.)


When I ran the simulation, I got this:


It acted as well as you could expect a low density cloth sim to run, but it all worked the way it should. I didn't have any problems until I got into engine.
Once in, i checked the skeleton and all seemed normal, save for a strange red line pointing into the distance and I have no idea what it is. The mesh was exported from world position 0,0,0 so I don't understand what that red line is indicating. I applied a simple blank material to the mesh with the "used for clothing" box ticked.


After loading in the APEX clothing file and setting it to LOD0, this happened.



The mesh just distorted horrifically in front of me. It didn't simulate the way I expected it to at all, it just broke and started going crazy. Even when I placed the mesh in world, the same thing happened.

I have absolutely no idea why it's doing this, has anyone encountered this problem before and if so, how did you fix it?

Thank you all for your time!

Replies

  • Seraphim3D
    Options
    Offline / Send Message
    Seraphim3D null
    Just for my own curiosity, i dug up that old project I mentioned to take a look at the flag. Same red line, but no distortion, the flag behaves as expected. I can't work out why this older experiment worked and the new one doesn't!

  • Mark Dygert
    Options
    Offline / Send Message
    The red line points to the world origin which corresponds to the world origin in 3dsmax. They do that so you know when the root is offset from 0,0,0. Most people move the root of the skeleton hierarchy to 0,0,0 before export.

    If you had an animation for the flag skeleton you could "enable root motion" or "force root lock" and it would snap to 0,0,0 and ignore the animation on the root joint. This is pretty common for characters that might have a walk cycle moving through a scene, but in game you want to lock that motion down and have an in place cycle that follows input from the player. If you don't have the root at the center, your mesh will be offset from it's capsule and rotation point.

    As for Apex misbehaving, it's always been a pain in the ass and it ran like ass too. I suspect your object in max has some dirty history or non-uniform scaling on the object level. I would collapse your object, reset xform and reskin it, move the root to 0 0 0 and export it again.

    ALSO... what version of unreal are you using? They are in the middle of overhauling apex and replacing it with a much faster solution, one that is easier to work with (or will be) and is totally contained inside of unreal. Right now it's still experimental but you can turn it on and try it out. 
    https://docs.unrealengine.com/latest/INT/Engine/Physics/Cloth/Overview/

    They still plan to support apex for a while longer but it's days are probably numbered.
Sign In or Register to comment.