[Bf-extensions-cvs] [af3ad31b] blender2.8: Merge branch 'master' into blender2.8
Philipp Oeser
noreply at git.blender.org
Mon Oct 15 10:12:37 CEST 2018
Commit: af3ad31ba4a21cf8849061301032cea4a915a73f
Author: Philipp Oeser
Date: Mon Oct 15 10:12:04 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBAaf3ad31ba4a21cf8849061301032cea4a915a73f
Merge branch 'master' into blender2.8
===================================================================
===================================================================
diff --cc io_scene_obj/import_obj.py
index 2bf4ac94,a8e945cd..916ff313
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@@ -303,22 -403,30 +303,22 @@@ def create_materials(filepath, relpath
emit_colors[:] = [
float_func(line_split[1]), float_func(line_split[2]), float_func(line_split[3])]
elif line_id == b'ns':
- if use_cycles:
- context_mat_wrap.hardness_value_set(((float_func(line_split[1]) + 3.0) / 50.0) - 0.65)
- context_material.specular_hardness = int((float_func(line_split[1]) * 0.51) + 1)
- elif line_id == b'ni': # Refraction index (between 1 and 3).
- if use_cycles:
- print("WARNING, currently unsupported glass material, skipped.")
- context_material.raytrace_transparency.ior = max(1, min(float_func(line_split[1]), 3))
+ # XXX Basic linear conversion, what would be best-matching formula here?
+ context_mat_wrap.roughness = 1.0 - (float_func(line_split[1]) / 1000)
+ context_material_vars.add("roughness")
+ elif line_id == b'ni': # Refraction index (between 0.001 and 10).
+ context_mat_wrap.ior = float_func(line_split[1])
context_material_vars.add("ior")
elif line_id == b'd': # dissolve (transparency)
- if use_cycles:
- context_mat_wrap.alpha_value_set(float_func(line_split[1]))
- context_material.alpha = float_func(line_split[1])
- context_material.use_transparency = True
- context_material.transparency_method = 'Z_TRANSPARENCY'
- context_material_vars.add("alpha")
+ context_mat_wrap.transmission = 1.0 - float_func(line_split[1])
+ context_material_vars.add("transmission")
elif line_id == b'tr': # translucency
- if use_cycles:
- print("WARNING, currently unsupported translucency option, skipped.")
- context_material.translucency = float_func(line_split[1])
+ print("WARNING, currently unsupported 'tr' translucency option, skipped.")
elif line_id == b'tf':
# rgb, filter color, blender has no support for this.
- pass
+ print("WARNING, currently unsupported 'tf' filter color option, skipped.")
elif line_id == b'illum':
- illum = int(line_split[1])
+ illum = get_int(line_split[1])
# inline comments are from the spec, v4.2
if illum == 0:
More information about the Bf-extensions-cvs
mailing list