Blender to Moho .obj import preserving textures

Have you come up with a good Moho trick? Need help solving an animation problem? Come on in.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Lae82
Posts: 32
Joined: Tue May 02, 2023 5:44 pm
Location: Sweden

Blender to Moho .obj import preserving textures

Post 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




-
Last edited by Lae82 on Mon Dec 18, 2023 7:24 pm, edited 2 times in total.
User avatar
Lae82
Posts: 32
Joined: Tue May 02, 2023 5:44 pm
Location: Sweden

Re: Blender to Moho .obj import preserving textures

Post 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.



-
User avatar
mmmaarten
Posts: 271
Joined: Mon Sep 19, 2022 2:19 pm
Location: Utrecht, The Netherlands
Contact:

Re: Blender to Moho .obj import preserving textures

Post by mmmaarten »

Thanks for sharing this tip! I'm currently not working with obj's but I'll bookmark it for when I do.
Adults should play more often
User avatar
synthsin75
Posts: 9978
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Blender to Moho .obj import preserving textures

Post by synthsin75 »

Same. Bookmarked for future reference.
Post Reply