Print at Dec 20, 2025, 7:38:40 AM

Posted by Puybaret at Dec 2, 2009, 5:23:41 PM
Re: Transparent (glass) furniture??
The easiest way should be to modify the MTL file before importing its sibling OBJ file.
A MTL file defines a set of materials i.e. colors with various parameters described in MTL specifications.
If you want to change the transparency of a material, you should change or add a line starting by "d" by setting a value between 0 (completely transparent) and 1 (fully opaque).

For example if your material file contains the following lines:

newmtl gray
Kd 0.25 0.25 0.25
Ks 0 0 0
Ka 0 0 0
illum 1
newmtl white
Kd 1 1 1
Ks 0 0 0
Ka 0 0 0
illum 1


And you want to make the gray color half transparent, you should have a "d" line like this:

newmtl gray
Kd 0.25 0.25 0.25
Ks 0 0 0
Ka 0 0 0
illum 1
d 0.5
newmtl white
Kd 1 1 1
Ks 0 0 0
Ka 0 0 0
illum 1


In fact, I just generated this example with Art Of Illusion, and discovered that you should always define the color of objects in AOI using textures and not materials (materials are not exported to OBJ files), and that AOI should be able to generate this "d" line, since it lets you choose the transparency of a texture.
It would be nice to post a new feature request for this in AOI. wink
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator