Skip to content
Snippets Groups Projects
Commit fa5cbcd0 authored by Bastien Montagne's avatar Bastien Montagne
Browse files

Fix T39487: Index Of Refraction when export to obj

Patch by Zer0 (vince), many thanks! :)
parent 8e6a2bec
No related branches found
No related tags found
No related merge requests found
...@@ -84,8 +84,8 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict): ...@@ -84,8 +84,8 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict):
fw('Ka %.6f %.6f %.6f\n' % (mat.ambient * world_amb)[:]) # Ambient, uses mirror color, fw('Ka %.6f %.6f %.6f\n' % (mat.ambient * world_amb)[:]) # Ambient, uses mirror color,
fw('Kd %.6f %.6f %.6f\n' % (mat.diffuse_intensity * mat.diffuse_color)[:]) # Diffuse fw('Kd %.6f %.6f %.6f\n' % (mat.diffuse_intensity * mat.diffuse_color)[:]) # Diffuse
fw('Ks %.6f %.6f %.6f\n' % (mat.specular_intensity * mat.specular_color)[:]) # Specular fw('Ks %.6f %.6f %.6f\n' % (mat.specular_intensity * mat.specular_color)[:]) # Specular
if hasattr(mat, "ior"): if hasattr(mat, "raytrace_transparency") and hasattr(mat.raytrace_transparency, "ior"):
fw('Ni %.6f\n' % mat.ior) # Refraction index fw('Ni %.6f\n' % mat.raytrace_transparency.ior) # Refraction index
else: else:
fw('Ni %.6f\n' % 1.0) fw('Ni %.6f\n' % 1.0)
fw('d %.6f\n' % mat.alpha) # Alpha (obj uses 'd' for dissolve) fw('d %.6f\n' % mat.alpha) # Alpha (obj uses 'd' for dissolve)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment