diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-09-17 16:26:52 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-09-17 19:55:15 +0300 |
commit | ec4ad081e564781230e3a9b31ef48f1f8fb71899 (patch) | |
tree | 5468926df074e0475c8530db97e60be47825ae54 /io_scene_fbx/import_fbx.py | |
parent | 051770b36de923a34a023ccd598dd315d2428f3a (diff) |
Shaders: update OBJ and FBX for for Principled BSDF emission strength
Diffstat (limited to 'io_scene_fbx/import_fbx.py')
-rw-r--r-- | io_scene_fbx/import_fbx.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index 3e0b2bfd..319c4972 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -1457,10 +1457,9 @@ def blen_read_material(fbx_tmpl, fbx_obj, settings): # We have no metallic (a.k.a. reflection) color... # elem_props_get_color_rgb(fbx_props, b'ReflectionColor', const_color_white) ma_wrap.normalmap_strength = elem_props_get_number(fbx_props, b'BumpFactor', 1.0) - # For emission color we can take into account the factor, but only for default values, not in case of texture. - emission_factor = elem_props_get_number(fbx_props, b'EmissiveFactor', 1.0) - ma_wrap.emission_color = [c * emission_factor - for c in elem_props_get_color_rgb(fbx_props, b'EmissiveColor', const_color_black)] + # Emission strength and color + ma_wrap.emission_strength = elem_props_get_number(fbx_props, b'EmissiveFactor', 1.0) + ma_wrap.emission_color = elem_props_get_color_rgb(fbx_props, b'EmissiveColor', const_color_black) nodal_material_wrap_map[ma] = ma_wrap @@ -3151,6 +3150,9 @@ def load(operator, context, filepath="", elif lnk_type in {b'EmissiveColor'}: ma_wrap.emission_color_texture.image = image texture_mapping_set(fbx_lnk, ma_wrap.emission_color_texture) + elif lnk_type in {b'EmissiveFactor'}: + ma_wrap.emission_strength_texture.image = image + texture_mapping_set(fbx_lnk, ma_wrap.emission_strength_texture) else: print("WARNING: material link %r ignored" % lnk_type) |