How to load model with texture at runtime

I am new to use the unreal engine. However, it really makes me frustrated.

What I want to do is simple: load model and texture it at runtime, change its position and rotation, then render the scene. I searched online, and find several plugins may related to loading model at runtime. runtime mesh import export plugin, or RuntimeMeshLoader. The ‘runtime mesh import export’ can not be installed on my mac. And the ‘RuntimeMeshLoader’ only work with the mesh part. For now, i haven’t found a solution to simply load model with texture. This really makes me confused: loading object and its texture is a basic step for 3d operations. For example, panda3d can do it well by just a load_model() function.

What I needed is to load some models (not static, each time the model list may change) and put them in the scene, then render. Anyone help here?

I also found RuntimeMeshComponent plugin, but I don’t find out how to load model file with it.

Hello.

  1. As for mesh - how complex are models that you want to load? Do they contain morph targets or skeleton and animation?

  2. You can import texture with ImportFileAsTexture2D node

Hi, my mesh don’t contain morph targets or skeleton animation.
Yeah, i can successfully import texture with ImportFileAsTexture2D function, but I don’t know how to apply the texture2d to mesh loaded with RuntimeMeshLoader plugin

Check the plugin RuntimeMeshComponent. It can load 3d model files at runtime.

It can load many common model file formats including obj, stl, fbx, x, 3ds, dae.

Unreal marketplace:

GitHub:

There several steps to do it in BP:

  • create Material, add several texture params and name them (for example Base color and etc)
  • CreateDynamicMaterialInstance node can make Dynamic Material Instance from Material asset
  • Load texture and use SetTextureParameterValue node to initialize Dynamic Material Instance
  • Get Static Mesh Component from your actor and use SetMaterial node to update

That’s all

1 Like