mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-23 21:16:54 +01:00
Reimplemented node deletion
This commit is contained in:
parent
d8d9aaa9b4
commit
9d650c98a1
@ -15,6 +15,13 @@ func get_port_source(gen_name: String, input_index: int) -> OutputPort:
|
|||||||
return OutputPort.new(get_node(c.from), c.from_port)
|
return OutputPort.new(get_node(c.from), c.from_port)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
|
func remove_generator(generator : MMGenBase):
|
||||||
|
var new_connections = []
|
||||||
|
for c in connections:
|
||||||
|
if c.from != generator.name and c.to != generator.name:
|
||||||
|
new_connections.append(c)
|
||||||
|
connections = new_connections
|
||||||
|
|
||||||
func connect_children(from, from_port : int, to, to_port : int):
|
func connect_children(from, from_port : int, to, to_port : int):
|
||||||
# disconnect target
|
# disconnect target
|
||||||
while true:
|
while true:
|
||||||
|
@ -54,7 +54,7 @@ func disconnect_node(from, from_slot, to, to_slot):
|
|||||||
send_changed_signal();
|
send_changed_signal();
|
||||||
|
|
||||||
func remove_node(node):
|
func remove_node(node):
|
||||||
generator.remove_node(node.generator)
|
generator.remove_generator(node.generator)
|
||||||
var node_name = node.name
|
var node_name = node.name
|
||||||
for c in get_connection_list():
|
for c in get_connection_list():
|
||||||
if c.from == node_name or c.to == node_name:
|
if c.from == node_name or c.to == node_name:
|
||||||
|
Loading…
Reference in New Issue
Block a user