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:
Diffstat (limited to 'io_scene_fbx/import_fbx.py')
-rw-r--r--io_scene_fbx/import_fbx.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 7efd3ab1..f2726047 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -591,7 +591,7 @@ def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset, glo
bl_obj = item.bl_obj
# We want to create actions for objects, but for bones we 'reuse' armatures' actions!
- grpname = item.bl_obj.name
+ grpname = bl_obj.name
# Since we might get other channels animated in the end, due to all FBX transform magic,
# we need to add curves for whole loc/rot/scale in any case.
@@ -1431,9 +1431,9 @@ def blen_read_material(fbx_tmpl, fbx_obj, settings):
# No specular color in Principled BSDF shader, assumed to be either white or take some tint from diffuse one...
# TODO: add way to handle tint option (guesstimate from spec color + intensity...)?
ma_wrap.specular = elem_props_get_number(fbx_props, b'SpecularFactor', 0.25) * 2.0
- # XXX Totally empirical conversion, trying to adapt it
- # (from 1.0 - 0.0 Principled BSDF range to 0.0 - 100.0 FBX shininess range)...
- fbx_shininess = elem_props_get_number(fbx_props, b'Shininess', 20.0)
+ # XXX Totally empirical conversion, trying to adapt it (and protect against invalid negative values, see T96076):
+ # From [1.0 - 0.0] Principled BSDF range to [0.0 - 100.0] FBX shininess range)...
+ fbx_shininess = max(elem_props_get_number(fbx_props, b'Shininess', 20.0), 0.0)
ma_wrap.roughness = 1.0 - (sqrt(fbx_shininess) / 10.0)
# Sweetness... Looks like we are not the only ones to not know exactly how FBX is supposed to work (see T59850).
# According to one of its developers, Unity uses that formula to extract alpha value: