OBJ files and textures

Exporting a textured object to OBJ doesn’t seem to store the texture info for me.
The MTL file just has the numeric data but no texture name.

What checkbox did I forget to tick ?

(Rhino 5.11.50226.17195, 2/26/2015 )

Hi Thomas- Works here so far- I thought it did not there for a second, but I’d made a mistake in assigning the material.


Could you try it on the Rhino built Rhino 5.11.50226.17195, 2/26/2015 ?
Is it me, or is it Rhino ? If it is me, what option did I miss ?


Hi Thomas- it seems to work fine from that build as well… very strange. Here is what my export dialog looks like:


My settings are similar ? (How come you get different greyed out options ?)
I get no texture definitions

(Could you try the educational version of that build ?)

@tim - do you have an idea what might be amiss? Thomas cannot get texture files in the obj mtl files he’s exporting.

@ThomasAn_ - the educational part should not matter- that is a licensing differenve, the software is the sane.


Since the dialog already makes different choices of what to grey out (for you versus for me), then I guess it’s one of those esoteric bugs that are probably not worth looking too much into.

Hi Thomas,

I just looked at the code for the exporter in V5. The first thing it does is an 8.3 file path with a combination of the OBJ output path and the file name and extension from the texture. Then it looks to see if that image is on the disk at the path in the Rhino texture. If it doer Rhino tries to make a copy of the image, if that fails you’ll get nothing in the mtl. If there is no file at the location of the path in the texture, Rhino will try to save the texture to the 8.3 filepath from the bitmap table. If that fails Rhino gives up on that texture and nothing gets written into the mtl file.


I just tried with a long texture file name and it was correctly handled as far as I can see-

6011CarbonGreyTileable.jpg >>>

map_Kd 6011CA~1.JPG


Ok, here is what I am finding out:

  1. Made sure to save Rhino (in case unsaved sessions affect it resolving file paths). No difference.
  2. Moved the texture from its folder to the same folder as the Rhino file. No difference.
  3. Assigned a different texture from the original folder. No difference.
  4. Created a brand new texture --> WORKS
  5. Checked permissions between the working texture and the non-working textures. No difference.
  6. Renamed the non-working texture to something like ttt.jpg -->WORKS

It seems renaming CalibrationCard.jpg -> ttt.jpg make it work. Renaming it back to CalibrationCard.jpg, makes it stop working.

Hi Thomas - see if you can verify if truncating the name to 8 characters or 9+ is the difference- that’s what it looks like to me- long names not handled correctly for some reason.


Yes. I was doing this right now.

It takes only texture filenames with exactly 9 characters or less (goes up to “Calibrati”). Any more characters and I get nothing in the mtl.

So far it looks like that is failing for some reason.


BTW, thanks for staying with me on this.
It wasn’t too bad (I initially feared something too esoteric, like system specific type casting bugs and such)

Hi Thomas,

Can you please send me the 3dm file and texture, in their non working state. Thanks.


Desktop.zip (9.9 KB)

(But there is nothing to it. A single surface with a texture)

Hi Thomas- the image does not show, here; instead, it looks like the texture on the plane is pointing at a different image than the one you included:

Some wires are crossed somewhere…


Sorry about that.
(Linked it, exported it, tested that it fails, but didn’t save rhino before packaging the zip)

Desktop.zip (9.9 KB)

Darn. Works here… let’s see what Tim finds.


Could it be a Windows thing ? (I am on 10 right now)

I notice the filename fails whenever it is long enough so that the desktop icon wraps it in two lines.