-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Debugger hierarchy is not the same between Standard Godot and Mono Godot #89326
Comments
That's not a bug. The Mono version of Godot adds a feature (C# support), which comes with some editor UI. The hierarchy of the editor is influenced by any plugins, even the editor debugger plugin you're using impacts it by adding a new dock. |
I see Example with indices: run_bar = Utils.find_child(editor_title_bar, "EditorRunBar")
var run_bar_buttons = run_bar.find_children("", "Button", true, false)
run_bar_play_button = run_bar_buttons[1] |
Not that I know of. Currently things which are not explicitly exposed in the API shouldn't be considered part of the API, and any future refactoring of internal editor code may break your plugin's expectations. We're aware that we don't expose enough things currently to allow plugins to mod the editor reliably, that's something that requires discussion to see what and how to expose more things and make them officially part of the API (which means less flexibility for engine developers to refactor code as there's more risk of breaking "soft" APIs, see e.g. #89302). There might be clever ways to figure out which button is which though, which would still not be supported / considered part of the API, but might be less prone to random changes. E.g. checking what's their icon, or the tooltip text... yeah this is bad :P CC @KoBeWi |
Basically this. In case of EditorRunBar, you can either find them by icon var target_button_icon := EditorInterface.get_editor_theme().get_icon(&"MainPlay")
for button: Button in run_bar_buttons:
if button.icon == target_button_icon:
return button or by shortcut: for button: BaseButton in run_bar_buttons:
if not button.shortcut:
continue
for event in button.shortcut.events:
if event is InputEventKey and event.keycode == KEY_F5:
return button or by tooltip text (although that's translated, so it's problematic). But as I said in #89225 (comment), if you want a robust and reliable way, the only possibility is opening a proposal for exposing it to the official API. What do you need the exact button for? (btw I recently started making a script called "Editor Hacks" that would provide methods for fetching or calling unexposed stuff, but it's not public yet; I'm collecting ideas for now). |
Hm I understand. Alternatively maybe there is some way to determine which version/architecture of Godot is being used? |
Sure, I'll close this issue as it's not an actionable bug report, but further discussion can happen in a proposal/discussion on godot-proposals or in a thread on the forum. We're definitely interested in hearing more about use cases from plugin developers to decide how to expand the existing API. |
Tested versions
System information
Windows 10 - Godot Engine v4.1.stable.mono.official.970459615 - https://godotengine.org Vulkan API 1.3.277 - Forward+ - NVIDIA GeForce GTX 1080 Ti
Issue description
Effectively, running the same exact GDScript code in Standard Godot results in the expected hierarchy, while running in Mono Godot results in an extra button (and likely other) minor differences in the Editor/Debugger structure. Have only noticed this discrepancy on the
EditorRunBar
so far, but there are likely other differences as well.Expected Standard and Mono Godot to have the same Editor hierarchy of objects/elements.
Creating a new, empty project results in the same differences.
Standard Godot
![image](https://private-user-images.githubusercontent.com/21691862/311461733-7cfb0e73-b60e-4ba0-8e02-99c96e3d37b2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzk2MTQsIm5iZiI6MTczOTEzOTMxNCwicGF0aCI6Ii8yMTY5MTg2Mi8zMTE0NjE3MzMtN2NmYjBlNzMtYjYwZS00YmEwLThlMDItOTljOTZlM2QzN2IyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIyMTUxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI1NzY2OGQ1NGQyODMyOTJhYWM2MGZjNWY0YTE5Y2M4ZjJhZDJiZmEzZDBkZTI0NjlkMWE5NGE0ZjA3ZWViYTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fwUi1j2eQQNhBeNo9QdYZC_urR9MAjd-3GsEHazfvps)
EditorRunBar
hierarchy:Mono Godot
![image](https://private-user-images.githubusercontent.com/21691862/311461741-06d17bff-9dc2-4ff9-9f37-dbdaa4192820.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzk2MTQsIm5iZiI6MTczOTEzOTMxNCwicGF0aCI6Ii8yMTY5MTg2Mi8zMTE0NjE3NDEtMDZkMTdiZmYtOWRjMi00ZmY5LTlmMzctZGJkYWE0MTkyODIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIyMTUxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ2MTg4MDVhYzI0M2IwYzhhZThkNjdmOGEzZDE4N2M5MjM3ODFkODBiZjc5MTRmZDQ1YmVkNmQyNzQyYzAyZDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BZN2mxPxsaS6h7cEXGtTI3taAVNR0t_T4Z9afWBkmj4)
EditorRunBar
hierarchy:Button
belowHBoxContainer@4075
Standard Godot
![image](https://private-user-images.githubusercontent.com/21691862/311462252-0fb63e75-49e3-480b-b6de-b451986f5faa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzk2MTQsIm5iZiI6MTczOTEzOTMxNCwicGF0aCI6Ii8yMTY5MTg2Mi8zMTE0NjIyNTItMGZiNjNlNzUtNDllMy00ODBiLWI2ZGUtYjQ1MTk4NmY1ZmFhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIyMTUxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJlNDdkM2YzZDk0ODUyZDc3MTg1YTZkZTE3ZDE1YzczODg3M2RiZjQ3Y2I3Y2YwYjU4NjBlM2VhYmM1YjI5MTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-8-lznay0Mm96_VN5ODrfnVEToZa_E_2QmGMsbwMal0)
EditorTitleBar
hierarchy (4.1):Mono Godot
![image](https://private-user-images.githubusercontent.com/21691862/311462263-f4cb06cb-69a3-49fa-af90-461a6e05c71d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMzk2MTQsIm5iZiI6MTczOTEzOTMxNCwicGF0aCI6Ii8yMTY5MTg2Mi8zMTE0NjIyNjMtZjRjYjA2Y2ItNjlhMy00OWZhLWFmOTAtNDYxYTZlMDVjNzFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDIyMTUxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc1OTQyMDU5YTU0YjJhOWFjZWIwYjRlMDYwZTg5YjY1ZmQ5ZmI4OTU1YzM5ZDI2OTc3OTdhZjdjNjJlYWVjZWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dSdRRdH4e9NxPdw18pdyjlS0eL6MGY81FlvJ1rF-jE4)
EditorTitleBar
hierarchy (4.1):Button
belowHBoxContainer@4829
Steps to reproduce
EditorTitleBar
and pressF12
keyEditorTitleBar
hierarchy is fully expandedButton
Minimal reproduction project (MRP)
editor-hierarchy-compare.zip
The text was updated successfully, but these errors were encountered: