DigiKrafting / blender_addon_pbr

Provides a material panel that creates Metallic/Roughness or Specular/Gloss Nodes using the Principled BSDF shader.
GNU General Public License v3.0
35 stars 5 forks source link

Receiving Error when adding files #8

Closed PaulJManoogian closed 5 years ago

PaulJManoogian commented 5 years ago

Hi, Here's the error I get in the script window:

Traceback (most recent call last):
  File "C:\Users\paulj\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\blender_addon_pbr-master\dks_pbr.py", line 617, in execute
    _nodes['dks_pbr_texture_'+self.node_name].image=bpy.data.images.load(_filepath)
KeyError: 'bpy_prop_collection[key]: key "dks_pbr_texture_normal" not found'

location: <unknown location>:-1

Can you tell me what I might have set up incorrectly? The file is saved before I add the normal, in this case.

DigiKrafting commented 5 years ago

I was unable to reproduce the error. I was able to replace the normal map without error. I also created the nodes via my Substance Painter addon and was able to replace the normal map via this addon. This error would only occur if the image texture node for the normal map was created manually and not by the addon, as an ID, in this case "dks_pbr_texture_normal" is assigned to the image texture node. If you're using with my Substance Painter addon, be sure to have the lastest versions of both addons installed as they are designed to work with each other and share the same ID's. I did however find a bug, when replacing the normal map texture image, the color space reverts to the default "SRGB". I'll upload a fix for that now. Please let me know if your using the latest versions of my addons and if you are, the steps i can take to reproduce the error.

DigiKrafting commented 5 years ago

It just occurred to me, did you create the nodes first via "Create - Auto Detect" or "Create Metallic Roughness" buttons? "Create - Auto Detect" requires the "Auto Textures Path" but if you click on the "Create Metallic Roughness" button, the nodes are created and images can be assigned. I'll update the addon to hide the assign/replace textire file buttons until the nodes are created to avoid confusion in using the addon.

DigiKrafting commented 5 years ago

I've uploaded a fix for the color space issue, the texture files are now hidden until the nodes are created and I've added a usage section to the readme to make this clear. Please let me know if this fixes the issue you had, thanks.