I´m working on tiny a scene exporter (lights, camera, geometry etc) which potentially could use the OBJ format to export / import geometry. Many material properties are perfectly translated using the OBJs mtl file which is great. However, at some point i´ve encountered that bump maps and environment maps assigned to the objects in Rhino are not put in the mtl file. Are there any plans to support that in V6 ?
i´ve found that the bump map is currently exported in the mtl file, it uses “map_Bump” so you can ignore the report about bump.
i´m not using any plugin materials, everything is assigned through the regular Rhino material dialog in properties. You can repeat the problem quite easy. Create any object, assign an environment map through object properties / material and export as obj. Use the option to write the materials (mtl file) when you export.
In the resulting mtl, the env map will not appear. According to this source it should be possible to put reflection maps or environment map info in the material file… along with many other useful things like map intensities, texture repeat etc. None of this seems to be supported by the obj / mtl exporter, it is missing specular maps too, but there is no slot for it in Rhino so i cannot complain about that
I’ve asked @tim for an opinion on this and I provided him with the sample files attached here. Please check the 3dm and if it is different than what you are doing, please upload your file. I’m not sure what’s possible from a coding standpoint but would guess that the basic Rhino material definition would need to have a specific texture channel or attribute in order to export information to a like area in the mtl file.
thank you, your example is enough, the assigned environment map is not listed in the mtl file. In my link above there is a description of syntax statements for reflection maps in .mtl files. I´m not shure if rhino should / can follow this exactly, but at least it could provide the opportunity to add it in the mtl file at all.
Maybe this is the right time to consider adding intensity values for texture, bumb, transparency and env maps too, but i´m not shure if this would break existing workflows of people using the mtl when importing OBJ files written with Rhino. It seems that many applications parse these files differently.
Can you get the latest WIP and see if environment maps are working for you? I hooked it up a little while back and forgot to mention anything here. It works for me round tripping into Rhino but Brian said he could not get them into Blender. I don’t have any apps here that will open OBJs besides Rhino. I thought SketchUp would (via import) but it doesn’t. Thanks.
i can confirm that it exports assigned environment maps (a single image) eg like this:
refl -type sphere mapname.jpg
i´ve not been able to get this into blender too, but i think this is an issue which belongs to another forum.
One question or bug report though: When i change the type of the previously assigned environment map to “cubemap” and assign all 6 images (px, nx, py, ny, pz, nz), the old name of the previously assigned single environment map is still displayed in the “basic” material dialog. This is a bit strange !?
If i then export that as *.obj file including the *.mtl option, the reflection type is still listed as “sphere” and a single file with a random name is built from the 6 cube map images. Is this expected ?
That’s interesting. What you’re seeing is what I would expect. Let me explain.
The “-type” being set as “sphere” was done by me. The documentation I have here says that sphere is the only type supported. However, I see from this page, http://paulbourke.net/dataformats/mtl/ (search for “Material reflection map”), that there are some others.
OBJ export is using the value for the “Environment Texture” of a material, if it exists, to set as the “refl” in the .mtl file. While I’m not certain that this is happening, I imagine the 6 images are combined into a single image to meet the single image (per texture type) criteria of the material. Since there is an interface in Rhino to set the 6 different images I may be able to get at that info in file I/O. If I’m able to do that I’ll try setting a refl for each variety but, there’s a good chance it still won’t work right in downstream apps. I suspect the texture coordinates are altered on the mesh to match the single image. So, they’ll probably be weird for 6 individual images. Round tripping may be challenging too but I won’t worry about that until I can figure out if I can get the export to work.
Looks like the filename/type for the “Environment Texture” not changing when you alter the type may actually be a bug. I’ll report that.
If I’m able to figure it out I’ll make the changes and let you know about it here.