Export mtl and obj

uncle808us

Active member
#1
Export mtl and obj

Why does C3D not export the obj file with the mil at one time?
I know about the script to do this but still wonder why C3D exports them separately.
Does anyone know?
I wish it would export them together instead of using a script.
 
#4
Hello. I can't seem to export .obj & .mtl files in a way that the materials work when imported into another app. I feel like there's some very basic step I can't figure out. Are there image files I should be exporting in some way? I see "Save Texture" but it just makes a clank (error) sound when I try it.

Thanks!
 
#6
Thanks Frank! That's what I'm missing, how do I generate/export the images? Is there a link that explains the entire process (or different ways to go about it)? Amazing how long this has dogged me.

Edit: maybe this thread will help me:
https://www.cheetah3d.com/forum/index.php?threads/11520/

I never realized the process was a bit involved. Like the person who started that thread, I'm extremely limited in my knowledge about 3D software, even though I've been using it from time to time for a long time.
 
Last edited:

frank beckmann

Well-known member
#7
In essence the baking process will project the textures onto your model - generate a flat UV map and will render the lighting conditions into it.
If you don´t know how to make a UV map Cheetah3d can generate it for you via "Baking UV coords:":
1. Make Object editable, add procedural material.
2. Set up lighting e.g. add a ambient light source for flat colours.
3. Click "baking texture"
4. At the tag: Choose UV1 for the use of default UVs coming with parametric objects
Or if you have already introduced a UV-layout or you don´t want to use the second UVset.
5. Hit Baking Texture icon.
6. save image.
7. Make new material and add rendered image to the diffuse channel.
8. Change new material against former procedural one at mesh.
9. Export (make sure OBJ+mtl+image files are at the same spot on your computer)

I recommend to get used to this process by starting with simple single objects and materials from the Cheetah3d library unless you´ll feel confident with the workflow.

Cheers
Frank
 
#9
Hi Frank,

I tried to follow your steps a few times, but for some reason the result didn't render right when I'd open the .OBJ in two other apps I'm using (Photoshop and Tilt Brush VR). But finally, one time I created an OBJ that had the material show up on both apps! But it seemed like I did the exact same steps each time, so I'm really confused about what I possibly could have done slightly differently the one time it worked (meaning I could see the material on the model in another app).

I decided to try and experiment. I opened a OBJ file in Cheetah3D, and saved it right back to the same folder as a newly named OBJ. These new OBJ files lacked the appearance of having a material when opened in Photoshop or Tilt Brush, but fine when opened in Cheetah3D. Strangely, Photoshop actually shows that the right material is connected to the model, but the material isn't actually rendered on the model for the files saved from Cheetah3D. No problem at all when I open the original OBJ file (not created by Cheetah3D). Same results when I "place" a model in Photoshop.

So, just to be sure it wasn't a quirk with both PSD and Tilt Brush, I decided to download Blender and import the OBJ files there. And I found Blender rendered ALL OBJ files I created with Cheetah 3D (or re-saved) perfectly! So it seems there's something about the way Cheetah3D is saving OBJ files that doesn't play nice with Photoshop and Tilt Brush. Any guesses on what is going wrong, and/or what I might do to work around the issue? My entire goal here is to create models in Cheetah3D and place them into Tilt Brush.

In case it helps, here's an example of the text from an original MTL file created by another application, compared to the MTL file created when I open and immediately re-save the OBJ (with a new name).

# 123D Sculpt Obj Exporter material file
# File Created : Thu Oct 18 12:49:56 2012

newmtl SculptMaterial
illum 1
Ka 1 1 1
Kd 1 1 1
Ks 0 0 0
map_Kd SculptShape.png
map_Ka SculptShape.png
vs
# WaveFront *.mtl file (generated by Cheetah3D)

newmtl default
Ns 64
Kd 0.700 0.700 0.700
Ks 1.000 1.000 1.000
Ka 0.700 0.700 0.700

newmtl SculptMaterial
Ns 0.000000
Tr 1.000000
Kd 1.000000 1.000000 1.000000
Ks 0.000000 0.000000 0.000000
Ka 0.1 0.1 0.1
map_Kd SculptShape.png
 
#11
I'm solid on the concept that we need OBJ + MTL + image files in the same folder, that isn't the problem. And I don't want to waste your time any more, as I fear it will be a lot more going back and forth and perhaps not really accomplishing anything. I was hoping you'd might see I need change some basic setting based on what I shared on my last post.

My issues seem to come down to the MTL files created by Cheetah3d - if I replace the text of the Cheetah3D MTL file with the text of the original MTL file, everything works as expected when I open the OBJ file created by Cheetah 3D in my various apps. At least this was the case when I tried it a couple of times.

I've now experimented opening Cheetah3D exports (both OBJ and FBX) in Blender, then re-saving them as an OBJ from Blender, and that works fine opening in all the apps I've tested, and without having to go through any of the steps you mentioned. The procedural materials seem to be simplified to the rough colors of each material, which is fine for what I'm doing.

I am left with the feeling that the OBJ + MTL files generated by Cheetah3D do not always play friendly with all other apps, since simply opening and saving an OBJ file with Cheetah 3D seems to make it not work right in some apps. But then importing theses problematic OBJ files (from Cheetah3D) in Blender, and re-saving them as OBJ files, seems to make them work fine in all the apps I test them on.

Thanks again on your time with this, I still learned a fair bit from your tutorial.
 
Last edited:

frank beckmann

Well-known member
#13
Ok - I made a simple example file: took a Ball with the colorfulchami material - made Ball editable - added baking tag - added ambient light source - baked to UV1 at 2k resolution - saved render as jpeg - made new material with baked image added to Ball and exported to OBJ+mtl.
This OBJ/mtl/Jpg files load in every 3d capable app I have at hand like: MeshLab, Blender, DAZstudio, Shade, Meshmixer, Hexagon, Silo, BalancerLite, FreeCAD, SweetHome3D, ClipStudioPaint ...
BakedColorfulchami.jpg


Cheers
Frank
 

Attachments

#14
Hi Frank,

The files you sent me also don't render correctly in Photoshop (the ball looks white). But if I import your OBJ into Blender and then export it as an OBJ (back to the same folder), the new OBJ+MTL renders correctly in Photoshop. I'm using the current version of Photoshop CC 2019 with Cheetah 3D 7.3.1. I tried PSD CC 2018 too and got identical results. In all examples, the OBJ, MTL, and PNG are in the same folder. I haven't had a chance to try it in Tilt Brush (it's on a PC), I'll update this post when I do (I'll try both sets of files again).

Oh, and note that I had said Blender worked fine with the Cheetah3D saves, so perhaps there's something unusual about the way Photoshop (and Tilt Brush) interpret the MTL files, but most 3D apps don't suffer this issue?

One more thing. Like before, if I use the MTL file created by Blender, with your OBJ (and PNG) files, the file opens as expected in Photoshop.

Thanks.
 
Last edited:
#16
I understand that, and think my statement is still accurate (even if the two apps I'm using are the only two that have issues with Cheetah3d OBJ+MTL exports). And I guess I added this update just as you were replying, so I'll add it here too: if I use the MTL file created by Blender, with your OBJ (and PNG) files, the file opens as expected in Photoshop.

UPDATE: Tile Brush opened your Cheetah 3D files correctly!
 
Last edited:
Top