Skip to content

Commit

Permalink
2_6_5
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DigiKrafting committed Jul 15, 2019
1 parent f7feb29 commit be09e37
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 32 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Prior to blender_addon_pbr 2.0.0

2.79.0

# Usage

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.

# Installation

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)
Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"name": "DKS PBR",
"description": "PBR Workflow Tools",
"author": "DigiKrafting.Studio",
"version": (2, 6, 0),
"version": (2, 6, 5),
"blender": (2, 80, 0),
"location": "Properties > Material > PBR Material",
"wiki_url": "https://github.com/DigiKrafting/blender_addon_pbr/wiki",
Expand Down
72 changes: 41 additions & 31 deletions dks_pbr.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,10 @@ def execute(self, context):
else:
_filepath=bpy.path.abspath(self.filepath)
_nodes['dks_pbr_texture_'+self.node_name].image=bpy.data.images.load(_filepath)

if self.node_name!="base_color":
_nodes['dks_pbr_texture_'+self.node_name].image.colorspace_settings.name = 'Non-Color'

return {'FINISHED'}

def invoke(self, context, event):
Expand Down Expand Up @@ -691,18 +695,20 @@ def draw(self, context):
_nodes = _material.node_tree.nodes

# Base Color

if 'dks_pbr_texture_base_color' in _nodes:

col=layout.row(align=True)
box=col.row()
box.label(text=node_name['base_color']['label'] +':',icon='IMAGE_DATA')
row=col.row().split(factor=0.80)
if 'dks_pbr_texture_base_color' in _nodes and _nodes['dks_pbr_texture_base_color'].image:
row.label(text=_nodes['dks_pbr_texture_base_color'].image.filepath)
else:
row.label(text='')
box=row.row().split(factor=0.50)
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='base_color'
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='base_color'
col=layout.row(align=True)
box=col.row()
box.label(text=node_name['base_color']['label'] +':',icon='IMAGE_DATA')
row=col.row().split(factor=0.80)
if 'dks_pbr_texture_base_color' in _nodes and _nodes['dks_pbr_texture_base_color'].image:
row.label(text=_nodes['dks_pbr_texture_base_color'].image.filepath)
else:
row.label(text='')
box=row.row().split(factor=0.50)
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='base_color'
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='base_color'

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

Expand Down Expand Up @@ -772,33 +778,37 @@ def draw(self, context):

# Normal

col=layout.row(align=True)
box=col.row()
box.label(text=node_name['normal']['label'] +':',icon='IMAGE_DATA')
row=col.row().split(factor=0.80)
if 'dks_pbr_texture_normal' in _nodes and _nodes['dks_pbr_texture_normal'].image:
row.label(text=_nodes['dks_pbr_texture_normal'].image.filepath)
else:
row.label(text='')
box=row.row().split(factor=0.50)
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='normal'
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='normal'

if _dks_pbr_material_options.option_orm_node==False:

# Roughness
if 'dks_pbr_texture_normal' in _nodes:

col=layout.row(align=True)
box=col.row()
box.label(text=node_name['roughness']['label'] +':',icon='IMAGE_DATA')
box.label(text=node_name['normal']['label'] +':',icon='IMAGE_DATA')
row=col.row().split(factor=0.80)
if 'dks_pbr_texture_roughness' in _nodes and _nodes['dks_pbr_texture_roughness'].image:
row.label(text=_nodes['dks_pbr_texture_roughness'].image.filepath)
if 'dks_pbr_texture_normal' in _nodes and _nodes['dks_pbr_texture_normal'].image:
row.label(text=_nodes['dks_pbr_texture_normal'].image.filepath)
else:
row.label(text='')
box=row.row().split(factor=0.50)
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='roughness'
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='roughness'
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='normal'
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='normal'

if _dks_pbr_material_options.option_orm_node==False:

if 'dks_pbr_texture_roughness' in _nodes:

# Roughness

col=layout.row(align=True)
box=col.row()
box.label(text=node_name['roughness']['label'] +':',icon='IMAGE_DATA')
row=col.row().split(factor=0.80)
if 'dks_pbr_texture_roughness' in _nodes and _nodes['dks_pbr_texture_roughness'].image:
row.label(text=_nodes['dks_pbr_texture_roughness'].image.filepath)
else:
row.label(text='')
box=row.row().split(factor=0.50)
box.operator(dks_pbr_texture_select.bl_idname, icon="FILE_FOLDER",text="", emboss=False).node_name='roughness'
box.operator(dks_pbr_texture_select_clr.bl_idname, icon="X",text="", emboss=False).node_name='roughness'

if 'dks_pbr_texture_emissive' in _nodes:

Expand Down

0 comments on commit be09e37

Please sign in to comment.