UE 4.27.2 Datasmith Runtime Import Bug

Hello! Recently I’m working on a project which needs to import .glb files in runtime. My approach is from UsingDatasmithAtRuntime.

But there was some issues of material and texture attachment.
This is the test scene I used, created by blender (Includes basic materials and textures, without cycles-specific nodes):

And you can see the bug of texture attachment from this video below. I just tried to debug again and then the texture appeared. Sometimes the material attachment will be wrong, too
https://youtu.be/ucgLi4uWpZg

Here is the message log (Material):

I’ve seen a similar issue from this topic: Ue4.27 datasmith Runtime import But I didn’t use MateriallnstanceDynamic. The materials and textures are in the glb files. Could you help me with this?

Are you manually assigning some materials or just letting datasmith import do it?

Can you share the test glb model?

This is the model: glb Test File

This is the BP. I just let datasmith handle that.

I could not reproduce.
are you on 4.27.2?

Two remarks:

  • You seem to be loading on begin play, could you load on a key event. Let see what happens when the engine do a few frame before loading.
  • your performances (gpu time) are abysmal for such a scene. You should be running at 120fps. I am confused what it is so. Could you try to find out? press “ctrl” + “shift” + “,” and try to see what is slowing down your gpu like that.

The issue on texture import might be a side effect of either loading too fast or something slowing down the engine.

Yes, this project is build in UE4.27.2.

About the GPU time, I’ve turned on ray-tracing and the SamplesPrePixel is at least 32, MaxBoucing is 3 or 4. The graphic card is GTX1080.

I will try to load on a key event later, thank you for the help!

I’ve tried key event. The problem may still happen. Note that there is a very low probability(About 5%) that the problem happens. Most times the pipeline is fine.

The image below represents the bug I met. It’s weird that the output log even doesn’t send any warning.

If you wonder whether the problem is in BP, you can get all my files and the output log of the above texture problem in this folder:
Datasmith Runtime
It’s not very comlicated.

Brief Pipeline:

  1. BP_Fileloader loads the json file test.json using custom blueprint function library BPFL_DataTableLoader. It will get glb paths and several properties, then put the information into a datatable.
  2. Datasmith loads the models using those paths. Datasmith should deal with the whole importing process (Mesh, Material, Texture)
  3. BP_SceneModifier do some simple transform changes on actors. This may not affect the importing.

The datatable importing part should be fine. I think the problem is datasmith from that message log of material problem I sent.

If you want to check my BP. You may want to check the file paths in test.json and BP_Fileloader. I’m using absolute paths. If the BP can’t work, please tell me.

You found any solution for that?

I was tring the same for the .udatasmith import from sketchup. In editor viewport it works fine but in the packaged project, I am getting the same green wierd material for all the meshes. glb import works fine for me.