Fixed issues #5 and #7

This commit is contained in:
RodZill4 2019-01-27 09:00:30 +01:00
parent 4baba77243
commit 0b7a36282e
3 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@
{ {
"tree_item":"Generators/Image", "tree_item":"Generators/Image",
"type":"image", "type":"image",
"file_path":"res://addons/material_maker/nodes/godot_logo.png" "file_path":"res://addons/material_maker/nodes/image/godot_logo.png"
}, },
{ {
"tree_item":"Generators/Pattern", "tree_item":"Generators/Pattern",

View File

@ -45,12 +45,12 @@ func get_textures():
list[name] = final_texture list[name] = final_texture
return list return list
func _get_shader_code(uv): func _get_shader_code(uv, slot = 0):
var rv = { defs="", code="" } var rv = { defs="", code="" }
var src = get_source() var src = get_source()
if src == null: if src == null:
return rv return rv
input_shader = get_parent().generate_shader(src.get_shader_code_get_globals("UV")) input_shader = get_parent().renderer.generate_shader(src.get_shader_code_with_globals("UV"))
_rerender() _rerender()
if generated_variants.empty(): if generated_variants.empty():
rv.defs = "uniform sampler2D %s_tex;\n" % [ name ] rv.defs = "uniform sampler2D %s_tex;\n" % [ name ]

View File

@ -19,7 +19,7 @@ func get_textures():
list[name] = $TextureButton.texture_normal list[name] = $TextureButton.texture_normal
return list return list
func _get_shader_code(uv): func _get_shader_code(uv, slot = 0):
var rv = { defs="", code="" } var rv = { defs="", code="" }
if generated_variants.empty(): if generated_variants.empty():
rv.defs = "uniform sampler2D %s_tex;\n" % [ name ] rv.defs = "uniform sampler2D %s_tex;\n" % [ name ]