Alembic Cache Imports from Maya - 'Flatten Tracks' and shaders

I am trying to import alembics created in Maya with the correct shader slots in Unreal.

Things I have done so far:

  1. Wrote a helper script in Maya to create face sets for each shading group (without this, unreal would not recognize the face sets)
  2. Export Alembic cache from maya with the UV Write, Write Color Sets, Write Face Sets, Whole Frame Geo, World Space, Write Visibility, and Write UV Sets on. HDF5 format.
  3. Import the Alembic Cache into Unreal with ‘Find Materials’ on and ‘Flatten Tracks’ on.
  4. The material slots are created, however only the first material gets applied to all the geo if ‘Flatten
    Tracks’ is on. This makes sense I guess, as all the geo is merged into one mesh.
  5. If I turn ‘flatten tracks’ off, Unreal crashes. It did work for very simple cases (I did a test with 3 spheres), but Unreal crashes if I try the same thing with a relatively low-poly character that has more pieces, in a 100 frame shot.

My question is, is there any kind of workaround to use ‘Flatten Tracks’ while still preserving material slots and their assignments? If ‘Flatten Tracks’ could preserve faceset names, that might solve it?

Also, it would be great if the Alembic Importer defaulted ‘Geometry Cache’ if it was detected to be an animated cache, set the importer to the start and end frames of the cache, and ‘skip empty frames’ was on by default.

Hi, sorry to jump on this post from a while ago.

I’m trying to do the same thing now, and looking for a Maya script to create face sets from all materials or shading groups, exactly as you have mentioned

I’m not a mel or python expert… do you possibly mind sharing that helper script
I would massively appreciate it!

Unreal alembic import works fine now in 4.23, but unlike unity you still have to create these face sets first, so I’m really struggling to automate this

Many thanks

EDIT:

I found the answer after a long trial

you don’t even need to create ANY face sets in maya anymore, you just need materials applied , which I already had.

It was down to unchecking “Flatten tracks” I don’t know why this is on by default?
… it is a simple checkbox on import “Flatten Tracks” TURN THIS CHECKBOX FROM HELL OFF!

Now all my material slots are there, and you just apply the materials back to the alembic