Skip to content

Commit

Permalink
Fix node location so it look better
Browse files Browse the repository at this point in the history
  • Loading branch information
chri11g6 committed Jul 21, 2019
1 parent 257a95d commit 1cd1edd
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions dks_sp.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def execute(self, context):
_material_output = _nodes.new('ShaderNodeOutputMaterial')

if not _file_Emissive:
_material_output.location = 600,0
_material_output.location = 800,0
else:
_material_output.location = 1600,0

Expand Down Expand Up @@ -242,7 +242,7 @@ def execute(self, context):
# Base Color

node=_nodes.new('ShaderNodeTexImage')
node.location = 0,250
node.location = -140,261
node.name='dks_pbr_texture_base_color'
_material_links.new(node.outputs['Color'], node_mix.inputs['Color1'])

Expand All @@ -256,7 +256,7 @@ def execute(self, context):
# Ambient Occlusion

node=_nodes.new('ShaderNodeTexImage')
node.location = 0,0
node.location = -140,0
node.name='dks_pbr_texture_ao'
_material_links.new(node.outputs['Color'], node_mix.inputs['Color2'])
node.image = bpy.data.images.load(_file_Ambient_occlusion)
Expand Down Expand Up @@ -294,7 +294,7 @@ def execute(self, context):
if _file_Specular:

node=_nodes.new('ShaderNodeTexImage')
node.location = 0,-250
node.location = -280,-180
node.name='dks_pbr_texture_Specular'
_material_links.new(node.outputs['Color'], node_shader.inputs['Specular'])
node.image = bpy.data.images.load(_file_Specular)
Expand All @@ -304,7 +304,7 @@ def execute(self, context):
# Roughness Invert

node_invert=_nodes.new('ShaderNodeInvert')
node_invert.location = 200,-450
node_invert.location = 100,-520
node_invert.name='dks_pbr_invert'
_material_links.new(node_invert.outputs['Color'], node_shader.inputs['Roughness'])

Expand All @@ -313,7 +313,7 @@ def execute(self, context):
if _file_Roughness!="":

node=_nodes.new('ShaderNodeTexImage')
node.location = 0,-500
node.location = -280,-520
node.name='dks_pbr_texture_roughness'
_material_links.new(node.outputs['Color'], node_invert.inputs['Color'])
node.image = bpy.data.images.load(_file_Glossiness)
Expand All @@ -334,25 +334,31 @@ def execute(self, context):
# Height
if _file_Height:

frame_1= _nodes.new('NodeFrame')
frame_1.location = -390, -837
frame_1.width = 802
frame_1.height = 628
frame_1.label = 'Normal and Height'

node_Bump=_nodes.new('ShaderNodeBump')
node_Bump.location = 250,-770
node_Bump.location = 250,-870
node_Bump.name='dks_pbr_Bump'
_material_links.new(node_Bump.outputs['Normal'], node_shader.inputs['Normal'])

node_map=_nodes.new('ShaderNodeNormalMap')
node_map.location = -20,-1050
node_map.location = -20,-1150
node_map.name='dks_pbr_normal_map'
_material_links.new(node_map.outputs['Normal'], node_Bump.inputs['Normal'])

node=_nodes.new('ShaderNodeTexImage')
node.location = -360,-1080
node.location = -360,-1180
node.name='dks_pbr_texture_normal'
_material_links.new(node.outputs['Color'], node_map.inputs['Color'])
node.image = bpy.data.images.load(_file_Normal)
node.image.colorspace_settings.name = 'Non-Color'

node=_nodes.new('ShaderNodeTexImage')
node.location = -360,-770
node.location = -360,-870
node.name='dks_pbr_texture_Height'
_material_links.new(node.outputs['Color'], node_Bump.inputs['Height'])
node.image = bpy.data.images.load(_file_Height)
Expand Down

0 comments on commit 1cd1edd

Please sign in to comment.