diff options
author | Robert Guetzkow <rjg> | 2020-12-09 14:19:13 +0300 |
---|---|---|
committer | Robert Guetzkow <gitcommit@outlook.de> | 2020-12-09 14:20:06 +0300 |
commit | ff83176c7f46ec16666bec79bbda5d0147b5ed7c (patch) | |
tree | 7452ae3fbcdee1a8db9a2a75f10c1449771033c5 /io_scene_x3d | |
parent | 1191a172ac389e3d068a8ef7d16f36457e67e3bc (diff) |
Fix T84328: Correct errors caused by renaming
In rBA6aa8e130eff59059886e203ff95221609f63b222 all occurrences
of "lamp" where replaced with "light" which also accidentally
renamed "clamp" to "clight". In case of the x3d importer and
object carver add-on this broke some functionality. This
commit fixes the names to match the use the correct properties
of the Python API and use semantically correct names for other
add-on where the renaming didn't cause functional changes.
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D9782
Diffstat (limited to 'io_scene_x3d')
-rw-r--r-- | io_scene_x3d/export_x3d.py | 28 | ||||
-rw-r--r-- | io_scene_x3d/import_x3d.py | 4 |
2 files changed, 16 insertions, 16 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index 517146cb..5ac7e557 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -48,7 +48,7 @@ H3D_CAMERA_FOLLOW = 'CAMERA_FOLLOW_TRANSFORM' H3D_VIEW_MATRIX = 'view_matrix' -def clight_color(col): +def clamp_color(col): return tuple([max(min(c, 1.0), 0.0) for c in col]) @@ -372,7 +372,7 @@ def export(file, ident_step = ident + (' ' * (-len(ident) + \ fw('%s<Fog ' % ident))) fw('fogType="%s"\n' % ('LINEAR' if (mtype == 'LINEAR') else 'EXPONENTIAL')) - fw(ident_step + 'color="%.3f %.3f %.3f"\n' % clight_color(world.horizon_color)) + fw(ident_step + 'color="%.3f %.3f %.3f"\n' % clamp_color(world.horizon_color)) fw(ident_step + 'visibilityRange="%.3f"\n' % mparam.depth) fw(ident_step + '/>\n') else: @@ -441,7 +441,7 @@ def export(file, fw(ident_step + 'radius="%.4f"\n' % radius) fw(ident_step + 'ambientIntensity="%.4f"\n' % amb_intensity) fw(ident_step + 'intensity="%.4f"\n' % intensity) - fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clight_color(light.color)) + fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clamp_color(light.color)) fw(ident_step + 'beamWidth="%.4f"\n' % beamWidth) fw(ident_step + 'cutOffAngle="%.4f"\n' % cutOffAngle) fw(ident_step + 'direction="%.4f %.4f %.4f"\n' % orientation) @@ -468,7 +468,7 @@ def export(file, fw('%s<DirectionalLight ' % ident))) fw('DEF=%s\n' % light_id) fw(ident_step + 'ambientIntensity="%.4f"\n' % amb_intensity) - fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clight_color(light.color)) + fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clamp_color(light.color)) fw(ident_step + 'intensity="%.4f"\n' % intensity) fw(ident_step + 'direction="%.4f %.4f %.4f"\n' % orientation) fw(ident_step + '/>\n') @@ -492,7 +492,7 @@ def export(file, fw('%s<PointLight ' % ident))) fw('DEF=%s\n' % light_id) fw(ident_step + 'ambientIntensity="%.4f"\n' % amb_intensity) - fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clight_color(light.color)) + fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clamp_color(light.color)) fw(ident_step + 'intensity="%.4f"\n' % intensity) fw(ident_step + 'radius="%.4f" \n' % light.distance) @@ -978,9 +978,9 @@ def export(file, ident_step = ident + (' ' * (-len(ident) + \ fw('%s<Material ' % ident))) fw('DEF=%s\n' % material_id) - fw(ident_step + 'diffuseColor="%.3f %.3f %.3f"\n' % clight_color(diffuseColor)) - fw(ident_step + 'specularColor="%.3f %.3f %.3f"\n' % clight_color(specColor)) - fw(ident_step + 'emissiveColor="%.3f %.3f %.3f"\n' % clight_color(emitColor)) + fw(ident_step + 'diffuseColor="%.3f %.3f %.3f"\n' % clamp_color(diffuseColor)) + fw(ident_step + 'specularColor="%.3f %.3f %.3f"\n' % clamp_color(specColor)) + fw(ident_step + 'emissiveColor="%.3f %.3f %.3f"\n' % clamp_color(emitColor)) fw(ident_step + 'ambientIntensity="%.3f"\n' % ambient) fw(ident_step + 'shininess="%.3f"\n' % shininess) fw(ident_step + 'transparency="%s"\n' % transp) @@ -1307,15 +1307,15 @@ def export(file, # XXX World changed a lot in 2.8... For now do minimal get-it-to-work job. # ~ blending = world.use_sky_blend, world.use_sky_paper, world.use_sky_real - # ~ grd_triple = clight_color(world.horizon_color) - # ~ sky_triple = clight_color(world.zenith_color) - # ~ mix_triple = clight_color((grd_triple[i] + sky_triple[i]) / 2.0 for i in range(3)) + # ~ grd_triple = clamp_color(world.horizon_color) + # ~ sky_triple = clamp_color(world.zenith_color) + # ~ mix_triple = clamp_color((grd_triple[i] + sky_triple[i]) / 2.0 for i in range(3)) blending = (False, False, False) - grd_triple = clight_color(world.color) - sky_triple = clight_color(world.color) - mix_triple = clight_color((grd_triple[i] + sky_triple[i]) / 2.0 for i in range(3)) + grd_triple = clamp_color(world.color) + sky_triple = clamp_color(world.color) + mix_triple = clamp_color((grd_triple[i] + sky_triple[i]) / 2.0 for i in range(3)) ident_step = ident + (' ' * (-len(ident) + \ fw('%s<Background ' % ident))) diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py index 653b8d9f..5d681a96 100644 --- a/io_scene_x3d/import_x3d.py +++ b/io_scene_x3d/import_x3d.py @@ -2822,9 +2822,9 @@ def appearance_LoadTexture(tex_node, ancestry, node): if bpyima: # Loading can still fail repeat_s = tex_node.getFieldAsBool('repeatS', True, ancestry) - bpyima.use_clight_x = not repeat_s + bpyima.use_clamp_x = not repeat_s repeat_t = tex_node.getFieldAsBool('repeatT', True, ancestry) - bpyima.use_clight_y = not repeat_t + bpyima.use_clamp_y = not repeat_t # Update the desc-based cache if desc: |