diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-05 00:31:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-05 00:31:19 +0400 |
commit | 42426f816bafae5d863f16dcb05135dfa773e387 (patch) | |
tree | 4c2db45540a83fc8ee19d323fa611924f379ac1c /io_scene_obj | |
parent | 30ab42921b158414caab48b6c94a3a988be5ed78 (diff) |
code cleanup: python - pass multiple args to string startswith() / endswith() functions rather than calling multiple times.
Diffstat (limited to 'io_scene_obj')
-rw-r--r-- | io_scene_obj/import_obj.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index 2ce97ec0..11fa543f 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -212,7 +212,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_ context_material.specular_hardness = int((float(line_split[1]) * 0.51)) elif line_lower.startswith(b'ni'): # Refraction index context_material.raytrace_transparency.ior = max(1, min(float(line_split[1]), 3)) # between 1 and 3 - elif line_lower.startswith(b'd') or line_lower.startswith(b'tr'): + elif line_lower.startswith((b'd', b'tr')): context_material.alpha = float(line_split[1]) context_material.use_transparency = True context_material.transparency_method = 'Z_TRANSPARENCY' @@ -330,11 +330,11 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_ img_filepath = line_value(line.split()) if img_filepath: load_material_image(context_material, context_material_name, img_filepath, 'Kd') - elif line_lower.startswith(b'map_bump') or line_lower.startswith(b'bump'): # 'bump' is incorrect but some files use it. + elif line_lower.startswith((b'map_bump', b'bump')): # 'bump' is incorrect but some files use it. img_filepath = line_value(line.split()) if img_filepath: load_material_image(context_material, context_material_name, img_filepath, 'Bump') - elif line_lower.startswith(b'map_d') or line_lower.startswith(b'map_tr'): # Alpha map - Dissolve + elif line_lower.startswith((b'map_d', b'map_tr')): # Alpha map - Dissolve img_filepath = line_value(line.split()) if img_filepath: load_material_image(context_material, context_material_name, img_filepath, 'D') |