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

Allow to copy/paste properties in the inspector #39398

Closed
wants to merge 1 commit into from

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jun 8, 2020

Addresses #23024
ezgif-6-542be88dac7f

Unfortunately I couldn't make the shortcuts working, because key events are hijacked by other editor controls. Could be done in another PR probably (maybe after #39039 is merged).

Bugsquad edit: This partially addresses godotengine/godot-proposals#1504.

@akien-mga
Copy link
Member

Seems like yesterday was inspector copypasta day :) #39404. CC @rcorre.
Won't the two features conflict with each other? (If shortcuts actually worked as expected in this PR.)

@KoBeWi
Copy link
Member Author

KoBeWi commented Jun 9, 2020

Won't the two features conflict with each other? (If shortcuts actually worked as expected in this PR.)

They would need different shortcuts.

btw the popup menu could be used to include the other feature too 🤔

@akien-mga
Copy link
Member

btw the popup menu could be used to include the other feature too thinking

Yeah maybe the copy property path feature could be Shift+Ctrl+C instead of Ctrl+C, if not taken already.

@rcorre
Copy link
Contributor

rcorre commented Jun 9, 2020

I would argue the opposite -- since ctrl+c is already used for copying a path (copy_node_path), it would make sense for ctrl+c to also be used for copying a property path, and ctrl+shift+c for copying the property itself.

I don't feel strongly though :)

@rcorre
Copy link
Contributor

rcorre commented Jun 9, 2020

eh, maybe not. copy_property_path might be more specialized (mainly for AnimationTree), whereas I could see copy_property used in a lot of places.

@KoBeWi
Copy link
Member Author

KoBeWi commented Jun 9, 2020

Remember that we have Paste Property too. It would be weird if copy used Shift and paste not (and counter-intuitive if both used Shift).

@name-here
Copy link

What about combining them and having paste be context-sensitive? Copy the thing, and it will paste either the path or property, depending on what you are pasting into. MacOS implements some things like this, where you can copy and paste, ex. photos, but it will paste different things based on context. It will paste the photo if the paste location accepts photos, paste the filename if you're targeting a normal text field, but pastes the file path if you're pasting into the terminal. Could Godot have something similar?

@rcorre
Copy link
Contributor

rcorre commented Jun 12, 2020

@name-here I think the resource clipboard is internal to godot and separate from the system clipboard. So we could have ctrl+c copy to both clipboards at once.

I'm not sure how useful that is though, as I think I'd typically know ahead of time which one I wanted to copy, and might not want to wipe out my other clipboard.

@KoBeWi
Copy link
Member Author

KoBeWi commented Aug 20, 2021

Superseded by #39404, which is the same but better 🤔

@KoBeWi KoBeWi closed this Aug 20, 2021
rcorre added a commit to rcorre/godot that referenced this pull request Aug 23, 2021
Resolves godotengine/godot-proposals#106.

Adds the following property menu options with default bindings:

- Copy Property (ctrl+c)
- Paste Property (ctrl+v)
- Copy Property Path (ctrl+shift+c)

If you hover over a property label in the inspector dock, you can copy
either the property value or the property path to the system clipboard
using the shortcuts above This is especially useful for the
`AnimationTree`, where code might reference properties like
"parameters/state/aim/move/blend_position".

One issue is that if you click a property, then click on the node you
currently have selected in the node tree, then press ctrl+shift+c, it
will still copy the selected property path rather than the node path. If
you click on a different node in the nodetree, however, ctrl+shift+c
will return to copying the nodepath.

The property value copy/paste was implemented by @KoBeWi at godotengine#39398 and
merged into this PR due to their similarity.
@KoBeWi KoBeWi deleted the inspepasta branch August 26, 2021 23:01
rcorre added a commit to rcorre/godot that referenced this pull request Dec 27, 2021
Resolves godotengine/godot-proposals#106.

Adds the following property menu options with default bindings:

- Copy Property (ctrl+c)
- Paste Property (ctrl+v)
- Copy Property Path (ctrl+shift+c)

If you hover over a property label in the inspector dock, you can copy
either the property value or the property path to the system clipboard
using the shortcuts above This is especially useful for the
`AnimationTree`, where code might reference properties like
"parameters/state/aim/move/blend_position".

One issue is that if you click a property, then click on the node you
currently have selected in the node tree, then press ctrl+shift+c, it
will still copy the selected property path rather than the node path. If
you click on a different node in the nodetree, however, ctrl+shift+c
will return to copying the nodepath.

The property value copy/paste was implemented by KoBeWi at godotengine#39398 and
merged into this PR due to their similarity.

Backport of 0205fff from master.
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