Merge branch 'blender-v4.3-release'

This commit is contained in:
Julien Duroure
2024-10-31 14:09:25 +01:00
2 changed files with 24 additions and 18 deletions

View File

@@ -5,7 +5,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"versio": (4, 4, 6),
"versio": (4, 4, 7),
'blender': (4, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@@ -82,25 +82,31 @@ def gather_data_sampled_keyframes(
if export_settings['KHR_animation_pointer']['materials'][blender_id]['paths'][channel][
'path'] == "/materials/XXX/extensions/KHR_materials_emissive_strength/emissiveStrength":
# We need to retrieve the emissive factor
factor = get_cache_data(
'value',
blender_id,
export_settings['KHR_animation_pointer']['materials'][blender_id]['paths'][channel]['factor_channel'],
action_name,
frame,
step,
export_settings
)
factor = [f * value for f in factor]
if any([i > 1.0 for i in factor or []]):
# Clamp to range [0,1]
# Official glTF clamp to range [0,1]
# If we are outside, we need to use extension KHR_materials_emissive_strength
value = max(factor)
if export_settings['KHR_animation_pointer']['materials'][blender_id]['paths'][channel]['factor_channel'] is not None:
factor = get_cache_data(
'value',
blender_id,
export_settings['KHR_animation_pointer']['materials'][blender_id]['paths'][channel]['factor_channel'],
action_name,
frame,
step,
export_settings
)
factor = [f * value for f in factor]
if any([i > 1.0 for i in factor or []]):
# Clamp to range [0,1]
# Official glTF clamp to range [0,1]
# If we are outside, we need to use extension KHR_materials_emissive_strength
value = max(factor)
else:
value = 1.0 # no need to have an emissiveStrength extension for this frame
else:
value = 1.0 # no need to have an emissiveStrength extension for this frame
# No factor exists, so set it as 1.0 / 1.0 / 1.0
# This is because the emission is linked to a texture, without a factor
# No need to change the value
factor = [1.0, 1.0, 1.0]
# For specularFactor and specularColorFactor, we already multiplied it by 2.0, and clamp it to 1.0 (and adapt specularColor accordingly)
# This is done in cache retrieval