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:
authorRobert Guetzkow <rjg>2020-12-09 14:19:13 +0300
committerRobert Guetzkow <gitcommit@outlook.de>2020-12-09 14:20:06 +0300
commitff83176c7f46ec16666bec79bbda5d0147b5ed7c (patch)
tree7452ae3fbcdee1a8db9a2a75f10c1449771033c5
parent1191a172ac389e3d068a8ef7d16f36457e67e3bc (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
-rw-r--r--io_scene_obj/__init__.py4
-rw-r--r--io_scene_obj/import_obj.py6
-rw-r--r--io_scene_x3d/export_x3d.py28
-rw-r--r--io_scene_x3d/import_x3d.py4
-rw-r--r--object_carver/carver_utils.py2
5 files changed, 22 insertions, 22 deletions
diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py
index e9fc8259..e20d50ea 100644
--- a/io_scene_obj/__init__.py
+++ b/io_scene_obj/__init__.py
@@ -110,7 +110,7 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
),
)
- global_clight_size: FloatProperty(
+ global_clamp_size: FloatProperty(
name="Clamp Size",
description="Clamp bounds under this value (zero to disable)",
min=0.0, max=1000.0,
@@ -196,7 +196,7 @@ class OBJ_PT_import_transform(bpy.types.Panel):
sfile = context.space_data
operator = sfile.active_operator
- layout.prop(operator, "global_clight_size")
+ layout.prop(operator, "global_clamp_size")
layout.prop(operator, "axis_forward")
layout.prop(operator, "axis_up")
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py
index 85db6aec..a303eda5 100644
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@ -905,7 +905,7 @@ def any_number_as_int(svalue):
def load(context,
filepath,
*,
- global_clight_size=0.0,
+ global_clamp_size=0.0,
use_smooth_groups=True,
use_edges=True,
use_split_objects=True,
@@ -1293,7 +1293,7 @@ def load(context,
axis_min = [1000000000] * 3
axis_max = [-1000000000] * 3
- if global_clight_size:
+ if global_clamp_size:
# Get all object bounds
for ob in new_objects:
for v in ob.bound_box:
@@ -1307,7 +1307,7 @@ def load(context,
max_axis = max(axis_max[0] - axis_min[0], axis_max[1] - axis_min[1], axis_max[2] - axis_min[2])
scale = 1.0
- while global_clight_size < max_axis * scale:
+ while global_clamp_size < max_axis * scale:
scale = scale / 10.0
for obj in new_objects:
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:
diff --git a/object_carver/carver_utils.py b/object_carver/carver_utils.py
index 1bd7455f..b026c1d1 100644
--- a/object_carver/carver_utils.py
+++ b/object_carver/carver_utils.py
@@ -326,7 +326,7 @@ def CreateBevel(context, CurrentObject):
mod.limit_method = 'WEIGHT'
mod.width = 0.01
mod.profile = 0.699099
- mod.use_clight_overlap = False
+ mod.use_clamp_overlap = False
mod.segments = 3
mod.loop_slide = False