USD reimport causes transient mesh reference

Hi

I think there has been a regression on a previous bug i reported that was fixed in 5.6 (https://issues.unrealengine.com/issue/UE\-264041\), but now seems broken again in 5.7

Please see the attached video for a detailed description. The issue is that assets which reference a mesh created by USD import are modified when that USD static mesh is reimported (legacy + interchange importers). In the case of blueprints and levelsequence references, these are changed to point to a Transient copy of the original static mesh (legacy importer only).

thanks

Luke

[Attachment Removed]

Steps to Reproduce

  1. Set `Interchange.FeatureFlags.Import.USD 0`
  2. Import a usd file to create a static mesh asset
  3. Add the static mesh as a actor to a level
  4. Add the static mesh as a component to an actor BP
  5. Add the static mesh as a spawnable binding in a level sequence
  6. Save All the assets
  7. Make an obvious visual modification to the source USD file
  8. Reimport the usd file
  9. Notice that both the BP and the level sequence don’t reflect the new mesh. They are modified and now point to “/Engine/Transient/…”. The reimport has broken them.

If I do the same with interchange, the updated mesh is updated everywhere as expected. However the level, BP and level seqeucne are all marked as modified. This is unexpected since they shouldn’t havent changed, only the mesh that the point to has changed.

[Attachment Removed]

Hi Luke,

Sorry for the delay. We’ve looked into this issue and have found the problem. It is not a regression from 5.6, it’s just another code path the previous fix did not take into account. We will have a fix soon that should properly handle all cases. The fundamental underlying issue in the legacy USDImporter is that a reimport will create a new asset instead of reusing the existing one and the reference in the package is not updated correctly, which is why the Blueprint points to the transient asset path.

This issue does not exist in Interchange since a reimport there will reuse the existing asset.

Also what you observe with the reimport of the static mesh dirtying other objects like the Blueprint and LevelSequence is the expected behavior (at least from the viewpoint of UE). The reimport of a static mesh triggers a recreation of the existing render contexts of the static mesh components that reference that static mesh. Internally, that recreation of the render context invalidates the lighting cache which dirties the static mesh component and its owner (actor, BP, level sequence, etc.). This is the correct behavior and will not change.

I’ll let you know once the fix will be available.

Best regards,

Anousack

[Attachment Removed]

Ok, I’ll see if it can be integrated to that stream once the fix is submitted to Main.

Regards,

Anousack

[Attachment Removed]

Hi Luke,

That’s the fix indeed. Can you make use of it since it’s in ue5-main, not the Partner-VP-5.7 stream?

[Attachment Removed]

Hi Anousack, we switched from a custom git branch to use the Partner-VP-5.7 stream since we share our project with some members of the epic solutions team, and we wanted to use the same engine. It would be great if it could be merged to that stream, but if its not feasible let me know and i’ll try apply it as a local patch here. Thanks so much

[Attachment Removed]

Hi Luke,

The fix has been integrated to the Partner-VP-5.7 stream and is available now.

[Attachment Removed]

Hi Anousack

Thanks so much. I will keep an eye out for the fix. Do you think its possible it can be be merged to the Partner-VP-5.7 stream?

cheers

Luke

[Attachment Removed]

Hi Anousack - is this the fix for this reimport issue:

https://github.com/EpicGames/UnrealEngine/commit/0e157f08fef6da7d9110cfaad5c4883a5e0d3581

[Attachment Removed]