Question About MDL Distillation and Material Handling in UE4

Hello,

I’m trying to get a workflow running through Omniverse into Unreal Engine and I’m running into some confusion with the connector and how it detects and distills MDL materials.

I’ve developed a connector that turns our scenes into .usd files but when it comes time to import scenes into UE4 using the connector my materials are failing to load in.

I have an example scene here with a bunch of different paint colors using the same mdl shader.

In my asset structure there is no top level ‘looks’ scope because everything is referenced/instanced - so all materials are contained in the part files. Seeing as we typically have many duplicated parts in our scenes we make extensive use of instancing. I had initially thought that it was the lack of a ‘looks’ scope on the top level of the scene that caused my mdls not to be detected, but that isn’t the case. Here is the scene in Create and the corresponding scene in UE4. Note the field circled in red containing the material location. Unreal makes no attempt to distill any mdls here and just loads in the geometry.






The strange behavior here is when I turn off instancing and override the mdl location in the shader (with the same exact file path) - UE4 then successfully detects that a material is present and imports/distills it into a UE4 material. All I did was press the ‘x’ button in the sourceAsset field of the shader, then press the folder button and locate it again - and the only noticeable difference is the addition of the ‘checkpoint’ field in the shader (which goes unused)


The two file paths are exactly the same, but the first was in my connector code as a string and appended as the material reference - whereas the second one here is what I get when I select the material on the server. Neither have any spaces:
…/…/Materials/nvidia/vMaterials/AEC/Paint/Flat.mdl <-This one doesn’t work
…/…/Materials/nvidia/vMaterials/AEC/Paint/Flat.mdl <-This one seems to work

I have also tried this with absolute file paths and was able to reproduce the same issue.

The one thing that’s apparent to me are those errors in the Create console window - ‘Failed to resolve usd asset identifier’
It’s strange that this is a create error but doesn’t result in any visible issue in the material loading in create, though I can’t help but feel it’s related to my issue

Here are the files for this project from my Nucleus Server - ‘Materials’ and ‘Projects’ need to be on the same filepath layer because of the relative filepaths in the usd file. All of the cubes in this demo should behave as I described.
UE4ServerFiles.zip (11.7 MB)

I feel like there’s something small and obvious that I’m missing - how can I get my materials to be detected and imported/distilled without having to edit the usd output of my connector?

Also my dome light appears to have stopped coming through even though it was working before - but I’m not really concerned about that.

Hello @LMTraina99! I let the team know about your post. Thanks for reaching out!

1 Like

Hi!

I experimented for a while and found the source of the issue. In my connector I had left on a debug option that uses absolute file paths for usd reference paths - so even though my top level usd was on the Omniverse server the parts it was referencing were on my local drive. Switching back to relative file paths as references led to everything open being contained on the server and the materials being detected - though the dome light still didn’t seem to come in correctly.

The behavior I described in the initial post is still curious - absolute file paths to a local drive seem to produce no issues loading in geometry - just materials (top level file is still opened from the server via UE4 connector). But when I update the material location it works just fine.

I agree with you, this definitely needs looked into. I created an internal dev ticket (OM-38950) for our developers to dig into this behavior.

1 Like

Matthew, the Unreal Connector doesn’t support local disk paths for USDs, Materials, or textures. The path must either be relative or an absolute Omniverse URL (omniverse://localhost/for/bar.usd).

I reproduced your issue by referencing the MDL S:/USD/OmniPBR_mdl in a stage. Create properly loads it works properly, Unreal fails to find it with this message:

LogOmniverse: Error: Package path is invalid. PackagePath:/Game/Omniverse//S:/USD/OmniPBR_mdl, OmniPath:S://USD/OmniPBR.mdl

I’m sorry it took so long for me to dig into this issue.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.