Better workflow/script for exporting palettes of level meshes to UE4?

The workflow for getting large numbers of static meshes (with associated collision, LODs, etc) from Maya to UE4 is kind of terrible right now. Since this seems like it ought to be a pretty much universal problem, I’m wondering if anyone knows of some existing Maya python/MEL scripts to solve this before I take on the work of building my own.

The problems as I see them are:

  • While multiple meshes can be placed in one FBX file and imported into UE4, this breaks the mesh reimport functionality.
  • Mesh pivots are placed at the world origin rather than at their own pivots. This means that you can’t layout an art palette in a single file since all the meshes have to be placed at the origin for export.
  • Existing Maya FBX export isn’t smart enough to automatically name the FBX file based on the mesh name. This means a full re-export of a level palette has the artist manually typing in dozens of file names.
  • There is no perforce plugin which supports Maya 2017, resulting in a ton of manual changelist management for artists.

Ideal workflow would allow artists to layout meshes in the Maya file however they want, allowing them to test snapping of different pieces in the palette and allow them to see the entire palette without having everything in a pile at the origin.
The export process should export each mesh in the Maya scene to a separate FBX file (to support reimport), automatically named to match the name of the static mesh piece.

I’d expect all of this to be fairly easy to implement by just adding either some expectations about how the level palette file was laid out, or perhaps by using some sort of helper object to group associated meshes together with their lod group and collision meshes, which is why I’m wondering if it’s already been done. But I’ve spent a fair bit of time searching for something and haven’t been able to turn anything up. Does anything like this currently exist?

I use Blender but for me reimporting files (or single meshes by right click - reimport) with multiple meshes works fine so I don’t see why it wouldn’t work in Maya. The meshes lose their own pivots if imported with the Transform Vertex To Absolute option, but if you’re designing the levels in Maya (or Blender) it works out fine because you can shift select everything and drag it out in the level and it will look exactly like it did in the 3d software.

This has some problems though, if you want to convert some things to BPs the mesh location is not at 0,0,0 so any blueprint components end up at a different location. This also means that anything like doors or similar objects that need special pivots won’t work. You could split the level into two parts though, one for everything that doesn’t need to move/interact which gets exported all at once and a second part for interactable things like doors/levers that get exported piece by piece at the world origin. You could then make BPs for these interactable meshes and if you designed the level on some sort of grid it’s pretty easy to snap them into place later.

Of course it would be best if you could have everything come into the level at the right places (like in the 3d software level) but with their own origins so you could use them as BPs right away. I think the Import into Level feature was meant to solve this but when I tested it it seemed pretty broken which is a shame.

I’m not building the level in Maya, just the palette of pieces which are used to build the level in the editor. I need individual pieces with correct pivots per object, not a giant mess of objects with pivots placed based on wherever they happened to be in the exported scene.

For me, right-clicking a static mesh asset and selecting reimport for a mesh which was imported from an FBX file which contains multiple meshes causes a reimport of all the static meshes into the single static mesh asset.

So if I export a maya scene containing a wall, a doorway, and a window into a single FBX file, when I import that FBX file into UE4 I get 3 static meshes: a wall, a window, and a doorway. But if I right-click the window and select reimport, it reimports all three meshes into what used to just be the window.

If you want the meshes exported at the center but be somewhere else (nicely lined up or whatever) you can make a script that saves the current transforms, temporarily moves the mesh to the center, exports, moves the mesh back. If you want to export multiple meshes in the same .fbx you will need to do this using for loops and an array for the transforms.

For reimporting a single mesh from an .fbx with multiple meshes you need to make sure UE4 can actually comprehend the filename. For example names with periods in the filename or spaces in the filename are not allowed in UE4 so they get converted to underscores. This means that UE4 won’t find the original mesh when reimporting because the file name was changed on import. So if you had mesh.1 in Maya it would turn into mesh_1 exported to an .fbx and imported in UE4. Then when reimporting UE4 will look for mesh_1 in your .fbx that does not exist. When this happens all meshes in the files are imported instead of crashing as a fallback.

It could be something else though, I don’t use Maya so I’m guessing the filename is the problem.