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

Implementation of EditorInspector.get_edited_object #7789

Closed
RadiantUwU opened this issue Sep 21, 2023 · 3 comments · Fixed by godotengine/godot#81425
Closed

Implementation of EditorInspector.get_edited_object #7789

RadiantUwU opened this issue Sep 21, 2023 · 3 comments · Fixed by godotengine/godot#81425

Comments

@RadiantUwU
Copy link

RadiantUwU commented Sep 21, 2023

Describe the project you are working on

A plugin that allows a whole team to work on a godot project all at the same time.

Describe the problem or limitation you are having in your project

Being able to get currently edited instance, the property, and the new value of it. You cannot currently get the object being edited, which is a huge limitation for me.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Implementation of #82069

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

@tool
extends EditorPlugin

func _print_property_edited(property: String):
	print(get_editor_interface().get_inspector().get_object_edited(),".",property)

func _enter_tree():
	# Initialization of the plugin goes here.
	get_editor_interface().get_inspector().property_edited.connect(_print_property_edited)


func _exit_tree():
	# Clean-up of the plugin goes here.
	get_editor_interface().get_inspector().property_edited.disconnect(_print_property_edited)

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

I'm unsure whether this is revealed to the GDExtension layer, but if it is or isn't, I believe it should still be added since its literally just one line of code and its already written.

@AnidemDex
Copy link

  • EditorPlugin implements _handles and _edit callback when an object is being edited
  • EditorInspectorPlugin will pass the edited object on each _parse_* callback
  • EditorProperty can use get_edited_object

Is it really needed?

@RadiantUwU
Copy link
Author

  • EditorPlugin implements _handles and _edit callback when an object is being edited

    • EditorInspectorPlugin will pass the edited object on each _parse_* callback

    • EditorProperty can use get_edited_object

Is it really needed?

It is veeery hard to make workarounds

@RadiantUwU
Copy link
Author

A workaround would be first making the inspector editor, inject a property editor for all properties given, make the property editors invisible so builtins take over, and then wait for any to get changed.

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

Successfully merging a pull request may close this issue.

5 participants