Editor import model is always black, do not know why, texture map lost

Editor import model is always black, do not know why, texture map lost

The model cannot show the actual colour without lights added in the scene.
Probably, you are trying to import the model without adding any light.
If you do add lights, the materials will show up as it assigns MeshStandardMaterial by default if it doesn’t detect the supported material.

It depends on what file format you are trying to import.

If its Threejs native JSON file with texture maps embedded within the JSON files as data URI, it will successfully import the textures as well.

For most of the other file format, AFAIK, they don’t contain the images as data URI. Instead, they rely on the names texture image files and those files come along as separate image file. So when you import, you actually import just the 3d model without texture file.

However, the texture parameters / setting does get detected properly.
All you would need to does is manually attached the texture image to their relavent materials.

1 Like

I also tried to upload some fbx models from the Web yesterday and none worked. Then I dug into code and it seems that loading of textures by names from your PC’s file system is impossible. There is a workaround for obj + mtl files now: they must be compressed in a zip file and named model.obj and materials.mtl. But I guess textures cannot be processed in that format.

Yes, excepting mtl file is possible but the feature is not yet implemented.
However, if the textures in the mtl file are just in form of image file reference ( instead of image data ), the problem with still remain the same (i.e) you will have to upload each textures manually in your target material.

I my case, I have modified the editor to support file fetching from already available scene ( hosted somewhere on the internet ). This method does not work when fetching from local machine due to several restriction between browser and window file system.

Honestly better improve threejs editor to up to standard for user.
Texture assign also missed of position, the UV is always stayed no issue but how come can rotate or flip the texture apply to the model? Cant be like that to waste user time in this simple step…