[Bf-extensions-cvs] [1aa75b05] blender2.8: Merge branch 'master' into blender2.8
Bastien Montagne
noreply at git.blender.org
Thu Oct 4 14:46:54 CEST 2018
Commit: 1aa75b050f1f00cc169bc96b00b11f97679ebe4f
Author: Bastien Montagne
Date: Thu Oct 4 14:46:32 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBA1aa75b050f1f00cc169bc96b00b11f97679ebe4f
Merge branch 'master' into blender2.8
Conflicts:
io_scene_obj/__init__.py
io_scene_obj/import_obj.py
===================================================================
===================================================================
diff --cc io_scene_obj/__init__.py
index 4fc670a9,3bebdecd..ac396b7e
--- a/io_scene_obj/__init__.py
+++ b/io_scene_obj/__init__.py
@@@ -21,8 -21,8 +21,8 @@@
bl_info = {
"name": "Wavefront OBJ format",
"author": "Campbell Barton, Bastien Montagne",
- "version": (3, 4, 0),
- "version": (2, 3, 7),
- "blender": (2, 78, 0),
++ "version": (3, 4, 1),
+ "blender": (2, 80, 0),
"location": "File > Import-Export",
"description": "Import-Export OBJ, Import OBJ mesh, UV's, materials and textures",
"warning": "",
diff --cc io_scene_obj/import_obj.py
index 8f914d6e,c47e6638..55e7648c
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@@ -148,19 -177,48 +148,19 @@@ def create_materials(filepath, relpath
elif type == 'Bump':
bump_mult = map_options.get(b'-bm')
- bump_mult = float(bump_mult[0]) if (bump_mult is not None and len(bump_mult) > 1) else 1.0
+ bump_mult = float(bump_mult[0]) if (bump_mult and len(bump_mult[0]) > 1) else 1.0
+ mat_wrap.normalmap_strength_set(bump_mult)
- if use_cycles:
- mat_wrap.normal_image_set(image)
- mat_wrap.normal_mapping_set(coords='UV', translation=map_offset, scale=map_scale)
- if bump_mult:
- mat_wrap.normal_factor_set(bump_mult)
-
- mtex = blender_material.texture_slots.add()
- mtex.use_map_color_diffuse = False
- mtex.texture = texture
- mtex.texture_coords = 'UV'
- mtex.use_map_normal = True
- if bump_mult:
- mtex.normal_factor = bump_mult
+ _generic_tex_set(mat_wrap.normalmap_texture, image, 'UV', map_offset, map_scale)
elif type == 'D':
- if use_cycles:
- mat_wrap.alpha_image_set(image)
- mat_wrap.alpha_mapping_set(coords='UV', translation=map_offset, scale=map_scale)
-
- mtex = blender_material.texture_slots.add()
- mtex.use_map_color_diffuse = False
- mtex.texture = texture
- mtex.texture_coords = 'UV'
- mtex.use_map_alpha = True
- blender_material.use_transparency = True
- blender_material.transparency_method = 'Z_TRANSPARENCY'
- if "alpha" not in context_material_vars:
- blender_material.alpha = 0.0
- # Todo, unset diffuse material alpha if it has an alpha channel
+ _generic_tex_set(mat_wrap.transmission_texture, image, 'UV', map_offset, map_scale)
elif type == 'disp':
- if use_cycles:
- mat_wrap.bump_image_set(image)
- mat_wrap.bump_mapping_set(coords='UV', translation=map_offset, scale=map_scale)
-
- mtex = blender_material.texture_slots.add()
- mtex.use_map_color_diffuse = False
- mtex.texture = texture
- mtex.texture_coords = 'UV'
- mtex.use_map_displacement = True
+ # XXX Not supported?
+ print("WARNING, currently unsupported displacement texture, skipped.")
+ # ~ mat_wrap.bump_image_set(image)
+ # ~ mat_wrap.bump_mapping_set(coords='UV', translation=map_offset, scale=map_scale)
elif type == 'refl':
map_type = map_options.get(b'-type')
More information about the Bf-extensions-cvs
mailing list