|
@@ -48,20 +48,22 @@ bool VisualScriptNode::is_breakpoint() const {
|
|
|
void VisualScriptNode::_notification(int p_what) {
|
|
|
|
|
|
if (p_what == NOTIFICATION_POSTINITIALIZE) {
|
|
|
-
|
|
|
- int dvc = get_input_value_port_count();
|
|
|
- for (int i = 0; i < dvc; i++) {
|
|
|
- Variant::Type expected = get_input_value_port_info(i).type;
|
|
|
- Variant::CallError ce;
|
|
|
- default_input_values.push_back(Variant::construct(expected, NULL, 0, ce, false));
|
|
|
- }
|
|
|
+ _update_input_ports();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void VisualScriptNode::ports_changed_notify() {
|
|
|
-
|
|
|
+void VisualScriptNode::_update_input_ports() {
|
|
|
default_input_values.resize(MAX(default_input_values.size(), get_input_value_port_count())); //let it grow as big as possible, we don't want to lose values on resize
|
|
|
+ int port_count = get_input_value_port_count();
|
|
|
+ for (int i = 0; i < port_count; i++) {
|
|
|
+ Variant::Type expected = get_input_value_port_info(i).type;
|
|
|
+ Variant::CallError ce;
|
|
|
+ set_default_input_value(i, Variant::construct(expected, NULL, 0, ce, false));
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
+void VisualScriptNode::ports_changed_notify() {
|
|
|
+ _update_input_ports();
|
|
|
emit_signal("ports_changed");
|
|
|
}
|
|
|
|