irajsb / UE4_Assimp

Assimp mesh importer for Unreal Engine
MIT License
136 stars 29 forks source link

External texture import #23

Closed zhang8043 closed 1 year ago

zhang8043 commented 1 year ago

After importing, the material of the model itself is not loaded. Does it lose the original meaning of Assist.

zhang8043 commented 1 year ago

If a model contains multiple materials, do you want to create all materials in the engine in advance?

irajsb commented 1 year ago

each material section is a separate mesh in assimp. are you using the sample project in releases tab?

zhang8043 commented 1 year ago

Yes, 5.4.2 EmbeddedTextureImport also has no material

zhang8043 commented 1 year ago

image

zhang8043 commented 1 year ago

All imported models are of this color

irajsb commented 1 year ago

Can you share one of the models so I can test for myself?

zhang8043 commented 1 year ago

https://github.com/assimp/assimp-mdb/tree/master/model-db/Obj/Spider

zhang8043 commented 1 year ago

Hello, you can use this OBJ model to test

zhang8043 commented 1 year ago

image

After importing UE

image

irajsb commented 1 year ago

That spider doesn't have embedded textures it has external textures . You have to pack textures inside the model in order to auto import them . if textures are not embedded assimp only gives you a path to textures and you've to import them yourself .
The reasons that I don't add support for auto importing external textures are :
1- I want to keep the code simple to understand for others 2- Unreal has support for multiple platforms and accessing files on other platforms requires third party plugins in some cases. I recommend glb format if you plan to use embedded textures here is an example: https://github.com/KhronosGroup/glTF-Sample-Models/blob/master/2.0/Corset/glTF-Binary/Corset.glb

zhang8043 commented 1 year ago

ok, thank you

irajsb commented 1 year ago

I'm going to see if I can add support for external textures using FImageUtils::ImportFileAsTexture2D(FilePath);

irajsb commented 1 year ago

https://github.com/irajsb/UE4_Assimp/releases/tag/ExternalTextureImport @zhang8043