mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
6c615aeb02
Created base framework and created simple operators
29 lines
633 B
GDScript
29 lines
633 B
GDScript
tool
|
|
extends GraphNode
|
|
|
|
var generated = false
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
func initialize_properties(object_list):
|
|
for o in object_list:
|
|
if o is LineEdit:
|
|
set(o.name, float(o.text))
|
|
o.connect("text_changed", self, "_on_text_changed", [ o.name ])
|
|
|
|
func _on_text_changed(new_text, variable):
|
|
set(variable, float(new_text))
|
|
get_parent().get_parent().generate_shader()
|
|
|
|
func get_source(index = 0):
|
|
for c in get_parent().get_children():
|
|
if c != self && c is GraphNode:
|
|
if get_parent().is_node_connected(c.name, 0, name, index):
|
|
return c
|
|
return null
|
|
|
|
func queue_free():
|
|
get_parent().remove_node(self.name)
|
|
.queue_free()
|