Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Node.is_part_of_edited_scene() #85515

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Nov 29, 2023

This PR does 3 things:

  • Remove SceneTree::is_node_being_edited(). It's function is the same as the newly added is_part_of_edited_scene(), but it requires a check whether node is inside scene tree
  • is_part_of_edited_scene() is now available outside editor, where it will always return false
  • Exposed is_part_of_edited_scene() to scripting

Closes godotengine/godot-proposals#8216
Closes (?) godotengine/godot-proposals#900

@@ -556,6 +556,12 @@
[method request_ready] resets it back to [code]false[/code].
</description>
</method>
<method name="is_part_of_edited_scene" qualifiers="const">
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is_part_of_edited_scene and not is_inside_edited_scene? I mean, I kind of get why, but it does not quite roll off the tongue.

Copy link
Member Author

Choose a reason for hiding this comment

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

idk, IMO this name is fine.
Also the method was changed a bit to include siblings of the scene, so is_inside_edited_scene() would be less accurate.

@KoBeWi KoBeWi force-pushed the is_node_part_of_edited_scene_and_being_edited() branch from 8d480be to 0b877a9 Compare April 26, 2024 09:49
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks good.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Apr 26, 2024
@akien-mga akien-mga changed the title Expose is_part_of_edited_scene() Expose Node.is_part_of_edited_scene() Apr 26, 2024
@akien-mga akien-mga merged commit 34a1287 into godotengine:master Apr 26, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the is_node_part_of_edited_scene_and_being_edited() branch April 26, 2024 13:29
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.

Add Node.is_being_edited() as an equivalent of Engine.is_editor_hint() for editor plugins
3 participants