PSA: How to fix broken APEX files from Maya's PhysX DCC 3.4.0 Plugin

Heya guys,

Recently I had a nasty run-in with a bug that caused APEX files from the latest version of Maya’s DCC Apex plugin to fail import. The error it would always say was “Could not find any valid submeshes. Either there are no submeshes, or all submeshes have zero simulated vertices.”

After being nudged in the right direction by Epic’s Benn Gallagher, I found a workaround. Mind you, this might not work for your specific files.

In any case, once you export your APEX you will have a .apx file. Open that in something like Notepad++ and look for numSimulatedVertices. In my case there were 2 entries, like so:



...

            <value name="numVertices" type="U32">2203</value>
            <value name="numSimulatedVertices" type="U32">637</value>
            <value name="numMaxDistance0Vertices" type="U32">99</value>
            <value name="numIndices" type="U32">12924</value>
            <value name="numSimulatedIndices" type="U32">3486</value>
            <value name="numBonesPerVertex" type="U32">4</value>

...


<array name="physicsMeshPartitioning" size="1" type="Struct" structElements="graphicalSubmesh(U32),numSimulatedVertices(U32),numSimulatedVerticesAdditional(U32),numSimulatedIndices(U32)">
            0 0 0 12924
</array>

Now, as Benn said correctly, the issue is in the second array. If you take a look at it, structElements defines what the 4 numbers inside the array are, so in order: graphicalSubmesh, numSimulatedVertices, numSimulatedVerticesAdditional and numSimulatedIndices. What you can see straight away is that the second number in the array, representing numSimulatedVertices is 0. This is why the import fails. However, you’ll also notice that numSimulatedIndices is identical for both the first search result and the second, so I thought “hey, maybe I can just fix the value manually”, and it worked.

So in my case the fix was to replace “0 0 0 12924” with “0 637 0 12924”. Your file will have a different number of vertices, but it shouldn’t be too hard to find.

Best regards,
Damir H.

This was my fix as well, is this the only fix?

Seems to be. The “permanent” fix is to use the in-engine clothing tools when 4.16 ships and stop using the agonizing PhysX plugin in its entirety.