Skip to content

Commit be09e37

Browse files
committed
2_6_5
Added hiding of Base Color, Normal Map, Roughness texture file display/open until nodes created and fixed color spaces reverting to default "sRGB" when texture files are set/replaced manually
1 parent f7feb29 commit be09e37

3 files changed

Lines changed: 46 additions & 32 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Prior to blender_addon_pbr 2.0.0
3232

3333
2.79.0
3434

35+
# Usage
36+
37+
Create the initial nodes required by the addon by clicking on "Create - Auto Detect", "Create Metallic Roughness" or "Create Specular Gloss" buttons. "Create - Auto Detect" requires a folder to be selected first. Then the Base Color, Normal Maps, etc file open/select buttons will show and can be selected manually if required.
38+
3539
# Installation
3640

3741
Download either the tar.gz or zip from [https://github.com/DigiKrafting/blender_addon_pbr/releases/latest](https://github.com/DigiKrafting/blender_addon_pbr/releases/latest)

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"name": "DKS PBR",
2121
"description": "PBR Workflow Tools",
2222
"author": "DigiKrafting.Studio",
23-
"version": (2, 6, 0),
23+
"version": (2, 6, 5),
2424
"blender": (2, 80, 0),
2525
"location": "Properties > Material > PBR Material",
2626
"wiki_url": "https://github.com/DigiKrafting/blender_addon_pbr/wiki",

dks_pbr.py

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,10 @@ def execute(self, context):
615615
else:
616616
_filepath=bpy.path.abspath(self.filepath)
617617
_nodes['dks_pbr_texture_'+self.node_name].image=bpy.data.images.load(_filepath)
618+
619+
if self.node_name!="base_color":
620+
_nodes['dks_pbr_texture_'+self.node_name].image.colorspace_settings.name = 'Non-Color'
621+
618622
return {'FINISHED'}
619623

620624
def invoke(self, context, event):
@@ -691,18 +695,20 @@ def draw(self, context):
691695
_nodes = _material.node_tree.nodes
692696

693697
# Base Color
698+
699+
if 'dks_pbr_texture_base_color' in _nodes:
694700

695-
col=layout.row(align=True)
696-
box=col.row()
697-
box.label(text=node_name['base_color']['label'] +':',icon='IMAGE_DATA')
698-
row=col.row().split(factor=0.80)
699-
if 'dks_pbr_texture_base_color' in _nodes and _nodes['dks_pbr_texture_base_color'].image:
700-
row.label(text=_nodes['dks_pbr_texture_base_color'].image.filepath)
701-
else:
702-
row.label(text='')
703-
box=row.row().split(factor=0.50)
704-
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='base_color'
705-
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='base_color'
701+
col=layout.row(align=True)
702+
box=col.row()
703+
box.label(text=node_name['base_color']['label'] +':',icon='IMAGE_DATA')
704+
row=col.row().split(factor=0.80)
705+
if 'dks_pbr_texture_base_color' in _nodes and _nodes['dks_pbr_texture_base_color'].image:
706+
row.label(text=_nodes['dks_pbr_texture_base_color'].image.filepath)
707+
else:
708+
row.label(text='')
709+
box=row.row().split(factor=0.50)
710+
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='base_color'
711+
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='base_color'
706712

707713
if (_dks_pbr_material_options.option_metallic_node == True and 'dks_pbr_texture_metallic' in _nodes):
708714

@@ -772,33 +778,37 @@ def draw(self, context):
772778

773779
# Normal
774780

775-
col=layout.row(align=True)
776-
box=col.row()
777-
box.label(text=node_name['normal']['label'] +':',icon='IMAGE_DATA')
778-
row=col.row().split(factor=0.80)
779-
if 'dks_pbr_texture_normal' in _nodes and _nodes['dks_pbr_texture_normal'].image:
780-
row.label(text=_nodes['dks_pbr_texture_normal'].image.filepath)
781-
else:
782-
row.label(text='')
783-
box=row.row().split(factor=0.50)
784-
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='normal'
785-
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='normal'
786-
787-
if _dks_pbr_material_options.option_orm_node==False:
788-
789-
# Roughness
781+
if 'dks_pbr_texture_normal' in _nodes:
790782

791783
col=layout.row(align=True)
792784
box=col.row()
793-
box.label(text=node_name['roughness']['label'] +':',icon='IMAGE_DATA')
785+
box.label(text=node_name['normal']['label'] +':',icon='IMAGE_DATA')
794786
row=col.row().split(factor=0.80)
795-
if 'dks_pbr_texture_roughness' in _nodes and _nodes['dks_pbr_texture_roughness'].image:
796-
row.label(text=_nodes['dks_pbr_texture_roughness'].image.filepath)
787+
if 'dks_pbr_texture_normal' in _nodes and _nodes['dks_pbr_texture_normal'].image:
788+
row.label(text=_nodes['dks_pbr_texture_normal'].image.filepath)
797789
else:
798790
row.label(text='')
799791
box=row.row().split(factor=0.50)
800-
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='roughness'
801-
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='roughness'
792+
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='normal'
793+
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='normal'
794+
795+
if _dks_pbr_material_options.option_orm_node==False:
796+
797+
if 'dks_pbr_texture_roughness' in _nodes:
798+
799+
# Roughness
800+
801+
col=layout.row(align=True)
802+
box=col.row()
803+
box.label(text=node_name['roughness']['label'] +':',icon='IMAGE_DATA')
804+
row=col.row().split(factor=0.80)
805+
if 'dks_pbr_texture_roughness' in _nodes and _nodes['dks_pbr_texture_roughness'].image:
806+
row.label(text=_nodes['dks_pbr_texture_roughness'].image.filepath)
807+
else:
808+
row.label(text='')
809+
box=row.row().split(factor=0.50)
810+
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='roughness'
811+
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='roughness'
802812

803813
if 'dks_pbr_texture_emissive' in _nodes:
804814

0 commit comments

Comments
 (0)