Page 1 of 1

Blender to Moho .obj import preserving textures

Posted: Mon Dec 18, 2023 7:02 pm
by Lae82
This is for those who scratch their heads when image textures (png/jpeg) are black in
Moho after importing 3D objects made in Blender.

First:
Correct texture path for .mtl file

When you export .obj from blender it also creates
a .mtl file where texture path is stored.

The .mtl file must have correct path
to where the texture image (jpg/png) is located.

Don't use absolute paths for texture images = C:/User/Folder/etc...
Use relative paths = textures/img.jpg

Open the .mtl file in a text editor.


Second:
Edit the path after "map_Kd" to where the texture image is located:

Example path with no subfolder
for image texture "cm1.png":

map_Kd cm1.png

--------------------------------------------------------------------

Example path with subfolder called "textures" for
image texture "cm1.png":

map_Kd textures/cm1.png


If everything is done correct your texture should appear in Moho if you import the 3D .obj file.


--------------------------------------------------------------------

Third:
Setup 3d object in Moho.

import .obj into moho.

Go to layer settings and disable:
Edges: Sillhouettes/Materials/Creases

Remove backfacing: uncheck

Shading:
Use Toon or Smooth shading




-

Re: Blender to Moho .obj import preserving textures

Posted: Mon Dec 18, 2023 7:18 pm
by Lae82
The default .mtl file can look like this when you open it in text editor:

# Blender 3.6.0 MTL File: 'doorbell.blend'
# www.blender.org

newmtl button
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd textures/button.png

newmtl doorbell
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd textures/button.png


You need to check the path is correct after map_Kd

newmtl = the name of the material created in Blender



Note:
Always UV unwrap to create UV map in blender for the 3d object
before .obj export.



-

Re: Blender to Moho .obj import preserving textures

Posted: Wed Dec 20, 2023 3:37 pm
by mmmaarten
Thanks for sharing this tip! I'm currently not working with obj's but I'll bookmark it for when I do.

Re: Blender to Moho .obj import preserving textures

Posted: Thu Dec 21, 2023 12:30 am
by synthsin75
Same. Bookmarked for future reference.