Skip to content

Commit

Permalink
Added Material Specular Flip
Browse files Browse the repository at this point in the history
- Flips Specular_Color into Specular_Hardness
  • Loading branch information
Menithal committed Apr 28, 2018
1 parent bde3383 commit 01b7ae2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 8 additions & 1 deletion hifi_tools/utils/materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def merge_textures(materials_slots, unique_textures=None):
bpy.context.object.active_material_index = index
bpy.ops.object.material_slot_remove()


def clean_materials(materials_slots):
try:
print("#######################################")
Expand Down Expand Up @@ -296,3 +295,11 @@ def clean_materials(materials_slots):
except Exception as args:
print("ERROR OCCURRED WHILE TRYING TO PROCESS TEXTURES", args)
# make_materials_fullbright(materials_slots) # enable this only if fullbright avatars every become supported

def flip_material_specular(material):
material.specular_color = (0, 0, 0)
for texture in material.texture_slots:
if texture is not None and texture.use_map_color_spec:
texture.use_map_color_spec = False
texture.use_map_hardness = True

6 changes: 1 addition & 5 deletions hifi_tools/utils/mixamo.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ def convert_mixamo_avatar_hifi():
mesh.clean_unused_vertex_groups(obj)

for material in bpy.data.materials:
material.specular_color = (0, 0, 0)
for texture in material.texture_slots:
if texture is not None and texture.use_map_color_spec:
texture.use_map_color_spec = False
texture.use_map_hardness = True
materials.flip_material_specular(material)

print("Texture pass")
materials.convert_to_png(bpy.data.images)
Expand Down

0 comments on commit 01b7ae2

Please sign in to comment.