Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-10-10 18:19:20 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-10-10 18:19:20 +0300
commitc4f78f14931be95e7f3bb31169579206369cc569 (patch)
tree11c4cf74c3203be0a2858be95d15187a4252cc3b /io_scene_fbx/import_fbx.py
parent3a0cc9946f6ce63213fec53876b4fbaed76d8311 (diff)
Fix T70666: FBX IO: Add support for new emission option of Principled BSDF.
Diffstat (limited to 'io_scene_fbx/import_fbx.py')
-rw-r--r--io_scene_fbx/import_fbx.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 9b8fbad1..93b01b9f 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -1427,6 +1427,10 @@ def blen_read_material(fbx_tmpl, fbx_obj, settings):
# elem_props_get_color_rgb(fbx_props, b'ReflectionColor', const_color_white)
# (x / 7.142) is only a guess, cycles usable range is (0.0 -> 0.5)
ma_wrap.normalmap_strength = elem_props_get_number(fbx_props, b'BumpFactor', 2.5) / 7.142
+ # 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)]
nodal_material_wrap_map[ma] = ma_wrap
@@ -3111,6 +3115,9 @@ def load(operator, context, filepath="",
elif lnk_type == b'Bump':
# TODO displacement...
"""
+ elif lnk_type in {b'EmissiveColor'}:
+ ma_wrap.emission_color_texture.image = image
+ texture_mapping_set(fbx_lnk, ma_wrap.emission_color_texture)
else:
print("WARNING: material link %r ignored" % lnk_type)