Skip to content

Commit

Permalink
ALB-29: Adding material transparency by default when importing
Browse files Browse the repository at this point in the history
  • Loading branch information
Brachi committed Mar 22, 2016
1 parent 484817a commit ef6ff77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions albam/mtframework/blender_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit ef6ff77

Please sign in to comment.