How to preserve static mesh asset import options post asset modification

We have an Editor Utility Widget that lets users bake vertex values to imported static meshes. This workflow is fantastic, but users noticed that running the tool removes all of the “import asset” functionality. This is understandable as the tool uses Geometry Scripting to create a new static mesh asset which is no longer related to the original imported asset. I was wondering if there is a way to preserve the import settings. Perhaps one way is to sample the imported static mesh, make modifications, get the original static mesh source file, export the newly generated dynamic mesh to the source fbx path and then re-import it. But I wanted to see if this is a viable option, or perhaps there is a better way.

Thank you in advance,

Richard Greenspan

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

Hi Richard,

The import settings should be in the AssetUserData of the StaticMesh. I would try duplicating those and adding them to your new StaticMesh.

You can call either GetAssetUserDataArray if you want to copy everything or GetAssetUserDataOfClass if you want to be selective. Then use DuplicateObject(AssetUserData, NewStaticMesh) to create a copy of the settings.

Finally, add them to your static mesh using NewStaticMesh->AddAssetUserData.

I hope this helps.

[Attachment Removed]

[mention removed]​

Is it assetUserData or assetImportData? I don’t really see anything in assetUserData.

[Attachment Removed]

Got it working. Here is what I ended up doing in the Editor Utility Widget:

First I get the filenames from the source static mesh asset:

[Image Removed]

Then I re-assign the fbx paths to the new static mesh asset:

[Image Removed]

[Attachment Removed]

Yes, you are correct it’s Asset Import Data not Asset User Data.

What you have copies over the source filename but will lose any custom import settings.

Could you instead copy the geometry of the new mesh into your existing static mesh asset using https://dev.epicgames.com/documentation/unreal\-engine/BlueprintAPI/GeometryScript/StaticMesh/CopyMeshtoStaticMesh?lang\=en\-US ?

[Attachment Removed]

Thanks [mention removed]​ the suggested node worked like a charm! I just had to transfer some of the source mesh options to keep things intact. Thanks for your help!

[Attachment Removed]

Thanks Jean-Michael! I will give this a try and will report back.

[Attachment Removed]

Thanks. Will give it a go.

[Attachment Removed]