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

Add a new method for EditorInspector "get_object_edited" #82065

Closed
wants to merge 2 commits into from
Closed

Add a new method for EditorInspector "get_object_edited" #82065

wants to merge 2 commits into from

Conversation

RadiantUwU
Copy link
Contributor

Would allow plugins to know which object is being edited, for a very useful case: live-editing, sending changes back to the server

Valid use:

@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)

Would allow plugins to know which object is being edited, for a very useful case: live-editing, sending changes back to the server
@AThousandShips
Copy link
Member

AThousandShips commented Sep 21, 2023

How is this different from get_edited_object?

Also you haven't actually added the bound method, only the binding, this won't work

@RadiantUwU
Copy link
Contributor Author

How is this different from get_edited_object?

Also you haven't actually added the bound method, only the binding, this won't work

Did i actually misspell it oh my god hold on

@fire
Copy link
Member

fire commented Sep 21, 2023

Do you need help creating a proposal for this? I can try guiding. https://github.com/godotengine/godot-proposals

@RadiantUwU
Copy link
Contributor Author

Do you need help creating a proposal for this? I can try guiding. https://github.com/godotengine/godot-proposals

I'll go do that right now, thanks.

@AThousandShips
Copy link
Member

AThousandShips commented Sep 21, 2023

There's already a method there called that, this already exists

See just a few lines above

@AThousandShips
Copy link
Member

This already is bound here:

ClassDB::bind_method(D_METHOD("get_edited_object"), &EditorProperty::get_edited_object);

@RadiantUwU
Copy link
Contributor Author

Superseded by #82069

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

Successfully merging this pull request may close these issues.

3 participants