From ef6ff77d9da0de7d3d1514861d2c204eee341ada Mon Sep 17 00:00:00 2001 From: Sebastian Brachi Date: Mon, 21 Mar 2016 23:02:30 -0300 Subject: [PATCH] ALB-29: Adding material transparency by default when importing --- albam/mtframework/blender_import.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/albam/mtframework/blender_import.py b/albam/mtframework/blender_import.py index 6b0be094..2e55ee8c 100644 --- a/albam/mtframework/blender_import.py +++ b/albam/mtframework/blender_import.py @@ -198,6 +198,9 @@ def _create_blender_materials_from_mod(mod, model_name, textures): materials = [] for i, material in enumerate(mod.materials_data_array): blender_material = bpy.data.materials.new('{}_{}'.format(model_name, str(i).zfill(2))) + blender_material.use_transparency = True + blender_material.alpha = 0.0 + blender_material.specular_intensity = 0.2 # would be nice to get this info from the mod materials.append(blender_material) for i, tex_index in enumerate(material.texture_indices): if tex_index == 0: @@ -224,8 +227,10 @@ def _create_blender_materials_from_mod(mod, model_name, textures): slot.use_map_normal = True slot.normal_factor = 0.05 elif i == 2: + # Specular slot.use_map_color_diffuse = False slot.use_map_specular = True + blender_material.specular_intensity = 0.0 elif i == 7: # cube map normal slot.use_map_color_diffuse = False