[Bf-extensions-cvs] [40340832] master: OBJ Import: better handling for metallic

Philipp Oeser noreply at git.blender.org
Fri Jan 4 15:04:12 CET 2019


Commit: 40340832e3992f46034b470aef1af6f7a3a4410f
Author: Philipp Oeser
Date:   Fri Jan 4 14:57:45 2019 +0100
Branches: master
https://developer.blender.org/rBA40340832e3992f46034b470aef1af6f7a3a4410f

OBJ Import: better handling for metallic

retrival of metallic (ab)uses OBJ material ambient term.
this can be non-zero, but in case of no reflections (OBJ 'illum' < 3)
metallic should be zero.

Fixes T60150

===================================================================

M	io_scene_obj/import_obj.py

===================================================================

diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py
index a8e08872..a065f7e1 100644
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@ -219,6 +219,9 @@ def create_materials(filepath, relpath,
             if do_reflection:
                 if "metallic" not in context_material_vars:
                     context_mat_wrap.metallic = 1.0
+            else:
+                # since we are (ab)using ambient term for metallic (which can be non-zero)
+                context_mat_wrap.metallic = 0.0
 
             if do_transparency:
                 if "ior" not in context_material_vars:



More information about the Bf-extensions-cvs mailing list