Skip to content

Commit c6755ce

Browse files
committed
use new "Node Identifiers" API for creating nodes
fixes #16
1 parent a3a3803 commit c6755ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

io_ogre/shader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def create_material_passes( mat, n=8, textures=True ):
8282
r = []
8383
x = 680
8484
for i in range( n ):
85-
node = tree.nodes.new( type='MATERIAL_EXT' )
85+
node = tree.nodes.new( type='ShaderNodeExtendedMaterial' )
8686
node.name = 'GEN.%s' %i
8787
node.location.x = x; node.location.y = 640
8888
r.append( node )
@@ -100,18 +100,18 @@ def create_texture_nodes( mat, n=6, geoms=True ):
100100
for i,m in enumerate(mats):
101101
r['material'] = m; r['textures'] = []; r['geoms'] = []
102102
inputs = [] # other inputs mess up material preview #
103-
for tag in ['Mirror', 'Ambient', 'Emit', 'SpecTra', 'Ray Mirror', 'Translucency']:
103+
for tag in ['Mirror', 'Ambient', 'Emit', 'SpecTra', 'Reflectivity', 'Translucency']:
104104
inputs.append( m.inputs[ tag ] )
105105
for j in range(n):
106-
tex = mat.node_tree.nodes.new( type='TEXTURE' )
106+
tex = mat.node_tree.nodes.new( type='ShaderNodeTexture' )
107107
tex.name = 'TEX.%s.%s' %(j, m.name)
108108
tex.location.x = x - (j*16)
109109
tex.location.y = -(j*230)
110110
input = inputs[j]; output = tex.outputs['Color']
111111
link = mat.node_tree.links.new( input, output )
112112
r['textures'].append( tex )
113113
if geoms:
114-
geo = mat.node_tree.nodes.new( type='GEOMETRY' )
114+
geo = mat.node_tree.nodes.new( type='ShaderNodeGeometry' )
115115
link = mat.node_tree.links.new( tex.inputs['Vector'], geo.outputs['UV'] )
116116
geo.location.x = x - (j*16) - 250
117117
geo.location.y = -(j*250) - 1500

0 commit comments

Comments
 (0)