diff --git a/addons/material_maker/new.ptex b/addons/material_maker/new.ptex deleted file mode 100644 index df087f9..0000000 --- a/addons/material_maker/new.ptex +++ /dev/null @@ -1 +0,0 @@ -{"connections":[],"nodes":[{"name":"Material","node_position":{"x":300,"y":0},"parameters":{"albedo_color":{"a":1,"b":1,"g":1,"r":1,"type":"Color"},"ao_light_affect":1,"depth_scale":1,"emission_energy":1,"metallic":1,"normal_scale":1,"resolution":1,"roughness":1},"type":"material"}]} \ No newline at end of file diff --git a/addons/material_maker/nodes/image.gd b/addons/material_maker/nodes/image.gd index 327de41..59b9508 100644 --- a/addons/material_maker/nodes/image.gd +++ b/addons/material_maker/nodes/image.gd @@ -4,6 +4,11 @@ extends MMGraphNodeBase func _ready() -> void: set_slot(0, false, 0, Color(0.5, 0.5, 1), true, 0, Color(0.5, 0.5, 1)) +func set_generator(g) -> void: + .set_generator(g) + generator.connect("parameter_changed", self, "on_parameter_changed") + $TextureButton.texture_normal = generator.texture + func set_texture(path) -> void: if path == null: return @@ -16,6 +21,9 @@ func get_textures() -> Dictionary: list[name] = $TextureButton.texture_normal return list +func on_parameter_changed(p, v) -> void: + $TextureButton.texture_normal = generator.texture + func _on_TextureButton_pressed() -> void: var dialog = FileDialog.new() add_child(dialog)