diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py index e9fc825932ef36cceefc8e87556df0d59d94a062..e20d50ead922a44d65f6fb752a12278f1cea1d1b 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 85db6aec52cfccb132e7aa4c1d5bf7cba1596ef8..a303eda50bfbb85bd9b48461ebbf16cfaabee570 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 517146cb23521da4b2f60b267be871198be28d56..5ac7e557650d5c7f5eb43846bc0b6be4d048e736 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 653b8d9f52881475ff4a3dda2bae3bf95f21942c..5d681a96f94f8bcabdecdb4474c304cec524300c 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 1bd7455fcf84c1c4b945d95871f2e793db5428f4..b026c1d141c7613db2fe30f1aba23edb91ec12de 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