Skip to main content
Participant
Mar 11, 2022 6:26 PM UTC
Question

Simple Bug in Blender Addon

I've encountered a bug while using the Substance3DInBlender addon, and it has a simple fix.
 
In the function "RefreshLoadedSBSARData" in the "persistance.py" file, in line 170, it tries to get mat.name for each material slot of every object in bpy.data.objects. The problem is, if an object has an empty material slot, it will return None for "mat" (it won't skip the empty slots) and the script gives an exception and stops working because it tries to get the ".name" attribute of a NoneType object.
 
The exact line that breaks the script is:
sbsarIndex = bpy.context.scene.loadedSbsars.find(mat.name)
 
It is simply solved by continuing the for loop if "mat" is None, by adding something like this before the line above:
    if not mat:
        continue
This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

PCA_72
Participating Frequently
Dec 29, 2022 2:38 PM UTC

Hi, is this information relative with a bug from loading the correct project material with SBSAR ?

I've encountered some bugs in the latest Blender versions and the Painter add-on. Loading materials errors and a lost of the sbsar materials already configured in the blender project. Not being able to load back the previously configured materials make the use of the add-on hazardous, especially if you've deadlines. Sad. Hope this can be solved rapidly.

Translate
Community Manager
Jan 12, 2023 6:35 PM UTC

Hi,

Could you share more information about what Painter Addon you are talking about?
Also, could you share the logs from the Blender console/terminal? 

Translate
PCA_72
Participating Frequently
Jan 12, 2023 6:57 PM UTC

Hi,

 

Painter Addon for Blender (Mac OSX 64) ver: 1.0.1

Substance integration tools 1.4.5

Translate
Inspiring
Mar 25, 2022 12:39 AM UTC

Just want to update you that this issue has been prioritized and is currently on our backlog. 

Translate
Community Manager
Mar 11, 2022 9:30 PM UTC

Thanks for reporting this issue and for the detailed information on a potential fix. We will investigate this.

Translate