Merge pull request #116970 from ryevdokimov/path3d-signal-fix

Fix duplicate signal error for `Path3D` when switching tabs
This commit is contained in:
Thaddeus Crews 2026-03-09 15:18:22 -05:00
commit 8130dde509
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -579,7 +579,6 @@ Path3DGizmo::Path3DGizmo(Path3D *p_path) {
// Connecting to a signal once, rather than plaguing the implementation with calls to `Node3DEditor::update_transform_gizmo`.
path->connect("curve_changed", callable_mp(this, &Path3DGizmo::_update_transform_gizmo));
path->connect("curve_changed", callable_mp(Path3DEditorPlugin::singleton, &Path3DEditorPlugin::_update_toolbar));
path->connect("debug_color_changed", callable_mp(this, &Path3DGizmo::redraw));
Path3DEditorPlugin::singleton->curve_edit->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw));
@ -780,7 +779,16 @@ void Path3DEditorPlugin::update_handles() {
}
void Path3DEditorPlugin::edit(Object *p_object) {
if (path) {
path->disconnect("curve_changed", callable_mp(this, &Path3DEditorPlugin::_update_toolbar));
}
path = Object::cast_to<Path3D>(p_object);
if (path) {
path->connect("curve_changed", callable_mp(this, &Path3DEditorPlugin::_update_toolbar));
}
_update_toolbar();
update_overlays();
}