godot icon indicating copy to clipboard operation
godot copied to clipboard

Added get_open_scenes_roots API to Editor Interface to retrieve all opened scenes root nodes

Open CycloneRing opened this issue 1 year ago • 2 comments

Added a single API get_open_scenes_roots to EditorInterface to retrieve all opened scenes root nodes instead of scene file paths.

  • Changes applied to editor_interface.h and editor_interface.cpp
  • Documentation added to EditorInterface.xml

CycloneRing avatar Oct 05 '24 04:10 CycloneRing

Thanks for contribution. Please squash the commits as it's required by our pipeline (see https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html).

Chaosus avatar Oct 06 '24 18:10 Chaosus

@Chaosus Done, I'm not sure if I did it correctly, This was my first time :D Let me know if ther's still a problem.

CycloneRing avatar Oct 06 '24 20:10 CycloneRing

Can we get this change merged? :)

CycloneRing avatar Dec 20 '24 11:12 CycloneRing

@Calinou Sorry to ping, Can we get this PR merged? It's already merged to other forks of Godot, I want to use jenova framework on official beta builds of 4.4

PR has no conflict and it's very easy to verify as it is a clone of same function just with different return type.

Thanks 🧔

CycloneRing avatar Feb 04 '25 11:02 CycloneRing

Sorry to ping, Can we get this PR merged?

We're currently in feature freeze for Godot 4.4, so we're not merging any new feature for the time being, even minor ones like this.

This still needs to be approved by contributors familiar with the EditorInterface API (cc @KoBeWi @passivestar ) and then it should be mergeable for 4.5.

akien-mga avatar Feb 04 '25 12:02 akien-mga

What's the use-case for this method? The implementation is fine (though the method should return TypedArray<Node>), but there is no proposal.

KoBeWi avatar Feb 04 '25 14:02 KoBeWi

What's the use-case for this method? The implementation is fine (though the method should return TypedArray<Node>), but there is no proposal.

@KoBeWi It's required for Jenova Fremework hot-reload feature, when we want to get opened scenes as actual instances instead of their name to iterate over nodes in open scenes, collect, restore etc.

I added this PR on Oct 5, 2024 it went to 4.4 milestone and now it's on 4.5! Blazium and Redot forks both merged while it's dusting in PR and this is unacceptable. Jenova is one of the biggest things happened to godot and people who want to use it are forced to use an alternative distro.

There is proposal : https://github.com/godotengine/godot-proposals/issues/10895 It's just sad this came from 2020 to now and still not merged :)

CycloneRing avatar Feb 04 '25 15:02 CycloneRing

Seems fine as far as API goes to have this in addition to the already existing get_edited_scene_root() method.

It's hard for me to understand the practical use-case though because I'm not familiar with the framework that you mentioned. Why does it need to hot-reload scenes in inactive tabs? Wouldn't it be better to do it lazily when a scene becomes active (i.e there's a EditorPlugin.scene_changed signal)?

passivestar avatar Feb 04 '25 15:02 passivestar

Seems fine as far as API goes to have this in addition to the already existing get_edited_scene_root() method.

It's hard for me to understand the practical use-case though because I'm not familiar with the framework that you mentioned. Why does it need to hot-reload scenes in inactive tabs? Wouldn't it be better to do it lazily when a scene becomes active (i.e there's a EditorPlugin.scene_changed signal)?

@passivestar I'm not the developer so i can't explain in detail but since the project brings incredible c++ scripting and hot-reloading, it require to update C++ nested nodes in opened scenes if it doesn't it lead to a crash as those pointers are gone after hot reload.

This is video from their channel showing hot-reloading: https://github.com/user-attachments/assets/5522afe3-309e-47cf-9800-1f566bf2db35

CycloneRing avatar Feb 04 '25 15:02 CycloneRing

Well, currently there is no way to get a scene root of another opened scene; you can only get the current scene. Adding a method that allows fetching other scenes probably makes sense šŸ¤”

KoBeWi avatar Feb 04 '25 15:02 KoBeWi

@KoBeWi @passivestar Thanks guys, I know you're in feature freeze, but I’d really appreciate it if you could make this happen in 4.4

CycloneRing avatar Feb 04 '25 16:02 CycloneRing

Congrats devs! jenova framework dropped official support of godot and moved to blazium... you guys are truly game changer :)

luna-hannington avatar Feb 14 '25 13:02 luna-hannington

@KoBeWi @akien-mga Can we get this PR merged now? Many people are waiting for this to switch to new version and it's been 5 months... :)

CycloneRing avatar Mar 05 '25 07:03 CycloneRing

It needs a rebase to pass CI, the macOS builds failed (the logs aren't available anymore so I assume this was a temporary CI fluke and not a bug in this PR).

@KoBeWi's suggestion to use TypedArray<Node> as return value is also good and should be included.

akien-mga avatar Mar 05 '25 08:03 akien-mga

It needs a rebase to pass CI, the macOS builds failed (the logs aren't available anymore so I assume this was a temporary CI fluke and not a bug in this PR).

@KoBeWi's suggestion to use TypedArray<Node> as return value is also good and should be included.

Yes, It first passed all checks and bugged out on second commit I did. Other forks that merged this change have successful build on all platforms. I agree with TypedArray<Node> as well, Btw, Should I do anything from my side?

CycloneRing avatar Mar 05 '25 09:03 CycloneRing

Well as I mentioned:

  • You should rebase the PR on current master
  • You should amend the commit to use TypedArray<Node>

But I guess I'll do it myself and tweak the commit message for clarity along the way.

akien-mga avatar Mar 05 '25 09:03 akien-mga

Well as I mentioned:

* You should rebase the PR on current `master`

* You should amend the commit to use `TypedArray<Node>`

But I guess I'll do it myself and tweak the commit message for clarity along the way.

Awesome, looks like everything works as expected. I tested the binaries from action and they all working.

CycloneRing avatar Mar 06 '25 04:03 CycloneRing

@akien-mga @AThousandShips Can this PR be merged? Everything looks good and they just added compatibility for new Godot release and I want to migrate from 4.3 soon as possible... image

CycloneRing avatar Mar 07 '25 12:03 CycloneRing

Please have some patience, we just released 4.4-stable and we're focusing on merging bug fixes right now and preparing a 4.4.1 bugfix release. This will be merged soon, it's slated for 4.5-dev1. If you want to use it, you can merge it in your own local branch, you'd need to do compile from source anyway once it's merged.

akien-mga avatar Mar 07 '25 12:03 akien-mga

Thanks! Congratulations on your first merged contribution! šŸŽ‰

Repiteo avatar Mar 11 '25 14:03 Repiteo