Page MenuHome

Error in OBJ exporter if material has a normal map
Closed, ResolvedPublic

Description

Blender Version
Broken: 2.80, 4b7596ec914e, 2019-01-05 20:52

Short description of error

Traceback (most recent call last):
  File "C:\blender-2.80.0-git.4b7596ec914e-windows64\2.80\scripts\addons\io_scene_obj\__init__.py", line 310, in execute
    return export_obj.save(context, **keywords)
  File "C:\blender-2.80.0-git.4b7596ec914e-windows64\2.80\scripts\addons\io_scene_obj\export_obj.py", line 797, in save
    EXPORT_PATH_MODE=path_mode,
  File "C:\blender-2.80.0-git.4b7596ec914e-windows64\2.80\scripts\addons\io_scene_obj\export_obj.py", line 739, in _write
    progress,
  File "C:\blender-2.80.0-git.4b7596ec914e-windows64\2.80\scripts\addons\io_scene_obj\export_obj.py", line 657, in write_file
    write_mtl(scene, mtlfilepath, EXPORT_PATH_MODE, copy_set, mtl_dict)
  File "C:\blender-2.80.0-git.4b7596ec914e-windows64\2.80\scripts\addons\io_scene_obj\export_obj.py", line 141, in write_mtl
    if mat_wrap.normalmap_strengh != 1.0:
AttributeError: 'PrincipledBSDFWrapper' object has no attribute 'normalmap_strengh'

location: <unknown location>:-1

If a model contains a material with the surface set to "Principled BSDF" (actually I'm not sure if the surface type even matters) and the material has a normal map, the exporter will error with the above. It looks to me that this is because normalmap_strength has been mistyped as normalmap_strengh.

Exact steps for others to reproduce the error

  1. Open the attached .blend file

  1. Try exporting the file as OBJ with "Write Materials" enabled
  2. The exporter will error