Get Selected Assets and Get Selected Level Actors - how to match array items to each other?

Hi,

Could do with some help with a blueprint I’m trying to make.

I have a maxscript that will take the selected objects in the 3DSMax viewport, put them to 0,0,0, export them to Unreal, then move them back. The second part of the maxscript then copies the transforms of the objects and pastes them to the clipboard. When I paste this in Unreal, an editor cube appears in the exact location of each object that I exported.

This allows me to take the imported FBX and use it as a static mesh for each of the spawned cubes - now I have items in the exact place they were in 3DSMax, in Unreal. No having to manually place things by eye, it’s just mm accurate and it works.

The issue is if I have a lot of objects, it’s time consuming to do this manually for each actor. I’ve started making a script that will assign a static mesh to each of the actors SELECTED in the outliner, if I have meshes selected in the content browser. It’s almost working, but I’ve found that whilst the “Get Selected Assets” will return an indexed array, “Get Selected Level Assets” will simply return every index as being 0. Meaning random meshes from my selection are assigned to my actors.

Ideally I’d like each named actor to have the correspondingly named FBX applied as it’s static mesh, but I’m not sure how to do this. Anyone have any ideas? I need this as automated as possible as I work in Arch Viz so accuracy and speed need to be perfect.

Any ideas? I’m not sure how to use Maps at the moment but I think that may be the way to go?


Ok, I actually fixed that problem. But now there is a new problem.

When I imported a large amount of FBXs, this did not work because the outliner and the content browser don’t list their objects using the same logic - meaning some objects are out of order and therefore get assigned the wrong mesh.

In case anyone stumbles on this in the future and wants to know the solution, here it is.

Use the attached script to export your meshes from Max (all meshes must be ungrouped or Unreal imports them with the wrong name), copy the mesh locations to the clipboard then paste in Unreal. Have all of your actors selected in the Outliner and all of your FBX meshes selected in the content browser, then run this utility widget. All your meshes will now be in Unreal in the exact same place as they were in Max, with centered pivot points, allowing you to maintain parity between both programs.

Very useful for Arch Viz when Datasmith isn’t suitable.

EDIT: The screenshot was drastically reduced in quality when I uploaded it. I’ve attached the BP .uasset also now. Made in version 5.4
FBX_Spawner_2.uasset (131.9 KB)

TS_UE5FBXExporter_2.ms (16.4 KB)