Naxela / The_Lightmapper

Fast and easy baked GI Lightmaps for Blender and Cycles
GNU General Public License v3.0
708 stars 52 forks source link

NoneType object has no attribute filepath_raw when trying to bake #60

Open rienheuver opened 3 years ago

rienheuver commented 3 years ago

I build a maze-like model, much like my previous issue but this time with much less faces. I enabled the lightmapper on all my models and then try to bake. I get the following error:

Traceback (most recent call last):
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/operators/tlm.py", line 25, in invoke
    build.prepare_build(self, False)
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/utility/build.py", line 78, in prepare_build
    begin_build()
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/utility/build.py", line 544, in begin_build
    manage_build()
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/utility/build.py", line 615, in manage_build
    nodes.exchangeLightmapsToPostfix("_baked", end, formatEnc)
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/utility/cycles/nodes.py", line 251, in exchangeLightmapsToPostfix
    img_name = node.image.filepath_raw
AttributeError: 'NoneType' object has no attribute 'filepath_raw'

location: <unknown location>:-1

Can't yet figure out what causes it, so any help is much appreciated!

Naxela commented 3 years ago

That seems strange, does it happen every time or just once? - If you turn on "Verbose" under the general settings, does it say anything else?

rienheuver commented 3 years ago

Happens every time, after a while though, not immediately. This is the output with verbose:

bpy.context.scene.TLM_SceneProperties.tlm_verbose = True
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.tlm.build_lightmaps()
The primary material node is not supported. Seeking first principled.
No principled found. Seeking diffuse
No supported nodes. Continuing anyway.
The primary material node is not supported. Seeking first principled.
No principled found. Seeking diffuse
No supported nodes. Continuing anyway.
The primary material node is not supported. Seeking first principled.
No principled found. Seeking diffuse
No supported nodes. Continuing anyway.
The primary material node is not supported. Seeking first principled.
No principled found. Seeking diffuse
No supported nodes. Continuing anyway.
The primary material node is not supported. Seeking first principled.
No principled found. Seeking diffuse
No supported nodes. Continuing anyway.
The primary material node is not supported. Seeking first principled.
No principled found. Seeking diffuse
No supported nodes. Continuing anyway.
Traceback (most recent call last):
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/operators/tlm.py", line 25, in invoke
    build.prepare_build(self, False)
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/utility/build.py", line 78, in prepare_build
    begin_build()
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/utility/build.py", line 544, in begin_build
    manage_build()
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/utility/build.py", line 615, in manage_build
    nodes.exchangeLightmapsToPostfix("_baked", end, formatEnc)
  File "/home/rienheuver/.config/blender/2.83/scripts/addons/The_Lightmapper-master/addon/utility/cycles/nodes.py", line 251, in exchangeLightmapsToPostfix
    img_name = node.image.filepath_raw
AttributeError: 'NoneType' object has no attribute 'filepath_raw'

location: <unknown location>:-1

Sounds like it has something to do with the use of the emission-materials on the lamps?

Naxela commented 3 years ago

Hi, it seems like that could very well be - I haven't added much support if emissive materials are inside the same mesh (slot) of an object that is being baked - Does it change anything if you select Skip material in the material properties?:

billede

rienheuver commented 3 years ago

Sorry it took so long, haven't been at this project for a while. Either way, no it doesn't change anything. The same error still pops up if I disable the emission-material of the lamp. I also tried disabling materials on the lamp (emissive and principled bsdf) and that didn't change a thing either.