You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Add connection-related VisualShader operations
- Insert a node in a connection - Drop an unconnected node on a connection to insert it - Delete a connection
This commit is contained in:
@@ -246,6 +246,20 @@ void VisualShaderNode::set_input_port_connected(int p_port, bool p_connected) {
|
||||
connected_input_ports[p_port] = p_connected;
|
||||
}
|
||||
|
||||
bool VisualShaderNode::is_any_port_connected() const {
|
||||
for (const KeyValue<int, bool> &E : connected_input_ports) {
|
||||
if (E.value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (const KeyValue<int, int> &E : connected_output_ports) {
|
||||
if (E.value > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VisualShaderNode::is_generate_input_var(int p_port) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user