diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2018-11-15 19:51:35 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2018-11-15 19:51:35 +0300 |
commit | a0e769eeb3603a30caf663c97f833f569e757b5f (patch) | |
tree | 274e3901580f27f5ad7af697393faf971257630a /io_scene_obj | |
parent | b424215f53e81338a7ba057a1d8d372104b7d335 (diff) |
OBJ import: Fix spec
Diffstat (limited to 'io_scene_obj')
-rw-r--r-- | io_scene_obj/import_obj.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index 5980a0b2..176a5a99 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -227,7 +227,7 @@ def create_materials(filepath, relpath, # TODO: Find a way to guesstimate best value from diffuse color... # IDEA: Use standard deviation of both spec and diff colors (i.e. how far away they are # from some grey), and apply the the proportion between those two as tint factor? - spec = sum(spec_color) / 3.0 + spec = sum(spec_colors) / 3.0 # ~ spec_var = math.sqrt(sum((c - spec) ** 2 for c in spec_color) / 3.0) # ~ diff = sum(context_mat_wrap.base_color) / 3.0 # ~ diff_var = math.sqrt(sum((c - diff) ** 2 for c in context_mat_wrap.base_color) / 3.0) @@ -297,7 +297,8 @@ def create_materials(filepath, relpath, col = (float_func(line_split[1]), float_func(line_split[2]), float_func(line_split[3])) context_mat_wrap.base_color = col elif line_id == b'ks': - spec_color = (float_func(line_split[1]) + float_func(line_split[2]) + float_func(line_split[3])) + spec_colors[:] = [ + float_func(line_split[1]), float_func(line_split[2]), float_func(line_split[3])] context_material_vars.add("specular") elif line_id == b'ke': # We cannot set context_material.emit right now, we need final diffuse color as well for this. |