• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Substance to blender plugin error when loading material

Community Beginner ,
Dec 14, 2022 Dec 14, 2022

Copy link to clipboard

Copied

2022-12-14_145014.png

 

I just installed the plugin from substance 3D to blender. I loaded a material, but then it says "(error)", I can't apply it to any object.

 

The object is UV-unwrapped, but the way it looks is like it doesn't matter what the object looks like, it's an error from loading the material.

 

Does anyone know what could be the problem?

TOPICS
Blender , Bugs & Crashes , Question

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jan 16, 2023 Jan 16, 2023

Here's the updated manager.py from this morning, that includes the second fix for the Duplicate button (lines 473 area), it is the same as the one posted in this thread. Apologies for the confusing interplay between threads.

 

If you do not use the Duplicate button in the plugin then there is no need to use this version, as I understand it. 

 

Glad to hear the patch is working for people!

 

 

Votes

Translate

Translate
Explorer ,
Dec 17, 2022 Dec 17, 2022

Copy link to clipboard

Copied

Blender changed an internal Python API - here's what I edited to get the plugin v1.0.1 working with Blender 3.4.

 

In the addon file 3.4/scripts/addons/Substance3DInBlender/material.py use a plain text editor to comment out these lines (prefix with '#') a couple lines after "Initialize shader sockets" to disable the crashing code, as shown:

 

                    # if _socket["source"] == "input" and _socket["name"] not in _items[_socket["id"]].inputs:
                    #     _items[_socket["id"]].inputs.new(_socket["type"], _socket["name"])
                    # elif _socket["source"] == "output" and _socket["name"] not in _items[_socket["id"]].outputs:
                    #     _items[_socket["id"]].outputs.new(_socket["type"], _socket["name"])

 

 

After those lines, put this alternate code that uses the preferred method from the developer site:

 

                    grptree = _sbs_group.node_tree
                    if _socket["source"] == "input" and _socket["name"] not in grptree.inputs:
                        grptree.inputs.new(_socket["type"], _socket["name"])
                    elif _socket["source"] == "output" and _socket["name"] not in grptree.outputs:
                        grptree.outputs.new(_socket["type"], _socket["name"])

 

 

Note that python is very sensitive to indentation! The new code should be very similar in indentation to the original version of the old code.

 

Your mileage may vary and this may not be a fully correct solution, but this seems to have fixed the plugin crash for me that started with Blender 3.4. Hope it helps!

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 17, 2022 Dec 17, 2022

Copy link to clipboard

Copied

Correction! this is in the file

 

3.4/scripts/addons/Substance3DInBlender/material/manager.py

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 17, 2022 Dec 17, 2022

Copy link to clipboard

Copied

Given the indentation sensitivity and that a user who attempted the patch likely caused a broken plugin after editing the code, I'm attaching the modified manager.py from plugin version 1.0.1 as a text file. Move the original file aside to a backup location, and rename this one from manager.py.txt to manager.py as its replacement. Changes are at lines 191-201, per the above recipe. As I understand it, offering this alternate edited file is consistent with GPL license - if not, I will take it down or forum managers are welcome to.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 13, 2023 Jan 13, 2023

Copy link to clipboard

Copied

thank you very much however by unzipping Substance3d 1.0.1 to replace and Re zipp it in which folder you replace your manager.py, in the material folder? as there is few material.py on different folder once you search for it.?

unless you do it in a different way in that case any steps or guidance to properly replace it.

I have issue on 3.4.1 blender version as my sbsar apply as Black on the cube or the sphere once applied the 1.01. and toolkit 1.4.5

thank you 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2023 Jan 15, 2023

Copy link to clipboard

Copied

C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Substance3DInBlender\material\

 

Macintosh-HD/User/USRENAME/Library/Application Support/Blender/3.4/scripts/addons/Substance3DInBlender/material/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2023 Jan 15, 2023

Copy link to clipboard

Copied

you are not supposed to unzip!

Install both and then change the installed files on your harddrive!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 16, 2023 Jan 16, 2023

Copy link to clipboard

Copied

Revolved from copying and pasting the patch on 3.4.1

1.0.1 substance and 1.4.5 toolkit (windows 10) what a work around

works like a charm

 

thank you very much

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2023 Jan 15, 2023

Copy link to clipboard

Copied

and 2nd one in line 473-476

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 16, 2023 Jan 16, 2023

Copy link to clipboard

Copied

Here's the updated manager.py from this morning, that includes the second fix for the Duplicate button (lines 473 area), it is the same as the one posted in this thread. Apologies for the confusing interplay between threads.

 

If you do not use the Duplicate button in the plugin then there is no need to use this version, as I understand it. 

 

Glad to hear the patch is working for people!

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 18, 2022 Dec 18, 2022

Copy link to clipboard

Copied

Thank you so much. Saved me from near madness with this!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 12, 2023 Jan 12, 2023

Copy link to clipboard

Copied

Hi,

We will be pushing an official update soon on the Substance website for this issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 12, 2023 Jan 12, 2023

Copy link to clipboard

Copied

Hi,

What version of Blender are you using? Also, is there any information on the Blender console/terminal that you could share with us? 

To view the console, go to the Windows menu -> Click on Toggle system console
For Mac: https://blender.stackexchange.com/questions/2078/how-to-use-blender-command-lines-in-osx 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2023 Jan 15, 2023

Copy link to clipboard

Copied

Hi Shwetha,

I can confirm this bug on both machines Win10 and macOS 12.6.2 an error appears when trying to load any material into the Substance Panel.

Blender add-on is working well with Blender 3.3 but thows back an error in 3.4 (win & mac).

Actual workaround is reinstalling Blender 3.3 or using the code change mentioned above.

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2023 Jan 15, 2023

Copy link to clipboard

Copied

not needed!

simply update the official plug-ins by adding k30n1 changes from above to the official plug-ins:

 

Blender changed an internal Python API - here's what I edited to get the plugin v1.0.1 working with Blender 3.4.

 

In the addon file 3.4/scripts/addons/Substance3DInBlender/material/manager.py use a plain text editor (better to use Brackets or Visual Studio Code for this!) to comment out these lines (prefix with '#') a couple lines after "Initialize shader sockets" to disable the crashing code, as shown:

 

                    # if _socket["source"] == "input" and _socket["name"] not in _items[_socket["id"]].inputs:
                    #     _items[_socket["id"]].inputs.new(_socket["type"], _socket["name"])
                    # elif _socket["source"] == "output" and _socket["name"] not in _items[_socket["id"]].outputs:
                    #     _items[_socket["id"]].outputs.new(_socket["type"], _socket["name"])

 

 

After those lines, put this alternate code that uses the preferred method from the developer site:

 

                    grptree = _sbs_group.node_tree
                    if _socket["source"] == "input" and _socket["name"] not in grptree.inputs:
                        grptree.inputs.new(_socket["type"], _socket["name"])
                    elif _socket["source"] == "output" and _socket["name"] not in grptree.outputs:
                        grptree.outputs.new(_socket["type"], _socket["name"])

 

 

Note that python is very sensitive to indentation! The new code should be very similar in indentation to the original version of the old code.

 

Your mileage may vary and this may not be a fully correct solution, but this seems to have fixed the plugin crash for me that started with Blender 3.4. Hope it helps!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 17, 2023 Jan 17, 2023

Copy link to clipboard

Copied

LATEST

Got it. We will be pushing an official update soon on the Substance website for this issue. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation
Download Latest Versions