Skip to content

Deprecate get_scene() in EditorScript class#109331

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
Open-Industry-Project:deprecate-get-scene
Nov 14, 2025
Merged

Deprecate get_scene() in EditorScript class#109331
Repiteo merged 1 commit into
godotengine:masterfrom
Open-Industry-Project:deprecate-get-scene

Conversation

@ryevdokimov

Copy link
Copy Markdown
Contributor

Related: #109049

This method should be marked as deprecated with the editor warning to properly guide users to use the correct method in the EditorInterface class. This PR finalizes the deprecations of all methods in the EditorScript class that already have equivalent outside functionality.

This will help track methods that should be removed during the next major update.

Comment thread editor/script/editor_script.cpp Outdated
Comment thread editor/script/editor_script.cpp Outdated
@AThousandShips AThousandShips added this to the 4.5 milestone Aug 5, 2025
@ryevdokimov ryevdokimov force-pushed the deprecate-get-scene branch 3 times, most recently from 32bb800 to f200141 Compare August 5, 2025 13:29
@Repiteo Repiteo modified the milestones: 4.5, 4.x Sep 18, 2025
@KoBeWi

KoBeWi commented Oct 22, 2025

Copy link
Copy Markdown
Member

I think this makes sense given #109049 was merged.

@KoBeWi KoBeWi modified the milestones: 4.x, 4.6 Oct 22, 2025

@Mickeon Mickeon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, shouldn't the underlying method be surrounded by #ifndef DISABLE_DEPRECATED?

@KoBeWi

KoBeWi commented Oct 22, 2025

Copy link
Copy Markdown
Member

It should.

Comment thread editor/script/editor_script.cpp Outdated
Comment on lines 88 to 92
ClassDB::bind_method(D_METHOD("add_root_node", "node"), &EditorScript::add_root_node);
#ifndef DISABLE_DEPRECATED
ClassDB::bind_method(D_METHOD("get_scene"), &EditorScript::get_scene);
#endif // DISABLE_DEPRECATED
ClassDB::bind_method(D_METHOD("get_editor_interface"), &EditorScript::get_editor_interface);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually all these methods are deprecated 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could take it from here after this PR is merged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Rebased, and fixed.

I also added WARN_DEPRECATED_MSG("EditorInterface is a global singleton and can be accessed directly by its name."); to the get_editor_interface() method to that it is consistent with the other ones.

@Repiteo Repiteo merged commit a04dd90 into godotengine:master Nov 14, 2025
20 checks passed
@Repiteo

Repiteo commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants