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

EditorProperty Copy value also to the clipboard #71275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Jan 12, 2023

"Copy Value" of property in the inspector was copying the value only within the context of the inspector, nothing was copied to the clipboard. See #66689 (comment). Now value.get_construct_string() is set to the clipboard.

  • This seems to work nice with the non-Object built-in types, including Arrays or Dictionaries (nested too).
  • Enum values are copied as the underlying value so e.g. 0 instead of PROCESS_MODE_INHERIT.
  • Not too useful for Resources, e.g.:
    • copying Texture produces something like Resource("res://icon.svg"),
    • copying scene's ShaderMaterial subresource produces Object(ShaderMaterial,"resource_local_to_scene":false,"resource_name":"","shader":null,"script":null)

Not sure if Resources should be handled somehow differently or if it's fine as is.

@akien-mga
Copy link
Member

Not too useful for Resources, e.g.:

  • copying Texture produces something like Resource("res://icon.svg"),
  • copying scene's ShaderMaterial subresource produces Object(ShaderMaterial,"resource_local_to_scene":false,"resource_name":"","shader":null,"script":null)

I wonder if we could copy the UID instead, or the scene SubResource path?

@akien-mga akien-mga requested a review from KoBeWi April 3, 2023 09:30
@KoBeWi
Copy link
Member

KoBeWi commented Apr 3, 2023

I found the current separate clipboard convenient a couple of times, but this option is fine too (and seems to be expected by some users).

Not too useful for Resources

And for Nodes, which become null. Maybe we could just disable this for TYPE_OBJECT.

@kleonc kleonc modified the milestones: 4.1, 4.x Jun 7, 2023
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.

4 participants