-
-
Notifications
You must be signed in to change notification settings - Fork 23.6k
Add support for copy/paste of section/category properties #111469
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
base: master
Are you sure you want to change the base?
Add support for copy/paste of section/category properties #111469
Conversation
6c550c1 to
e4d829f
Compare
|
Pasting when there was nothing copied creates an action named "Set category/group <null>". Also, the fact that the paste action in the popup uses "category" or "group" in the name is odd since "Paste Group Values" will actually paste a category if that's what you have copied. It should just be "Paste Copied Values" instead. |
I think copying properties from a category and pasting them into a group within that category should only paste the group's properties. This allows you to paste multiple groups within a single category without having to copy each group individually. But if the properties of a category are pasted into a group that is in another category, nothing should happen. |
1024aac to
b54c883
Compare
|
Feature seems to be working well. Those commits need to be squashed, however. |
b54c883 to
79b3fa4
Compare
YeldhamDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature-wise, everything seems to be working fine.
1934d9b to
23cc324
Compare
8f29df4 to
4ccf52b
Compare
|
I found unexpected behavior when pasting on multiple nodes. Screen.Recording.2025-10-13.130423.mp4 |
|
The undo/redo usage looks correct, but for some reason it creates "Set category" as global action and makes individual action for each property. Something is wrong. |
|
Yeah, the thing is, this code Is only called for the object that is selected in the inspector (so the last one selected?). So the values pasted onto the other object are handled by something else. |
|
Ok I see what's the problem, but fixing it will involve modifying MultiNodeEdit. This is a bit messy, so I think you can just put a big FIXME comment and I will do a follow-up PR once this is merged. EDIT: |
|
I realized it's wrong either way. You can't undo a property change on all nodes at once, because MultINodeEdit can't retrieve current value from all nodes, it will just use the first node. So if you want proper undo/redo, you will need to manually set properties on each node. |
What approach should I take then ? |
|
Check if You might need to do the same for EditorDebuggerRemoteObjects. |
0b76af7 to
b2428fb
Compare
Added Copy/Paste Properties For Categories Fixed SubGroup Not Showing PopupMenu Disables popmenu on unchecked groups Format code Changed _collect_properties for EditorInspectorCategory and EditorInspectorSection Fixed coding style Fixes copy/paste for EditorInspectorArray Fixes check for EditorInspectorArray Fixes empty paste null reference + Allow to copy/paste group using hierarchy Apply suggestions from code review Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com> Prevents modification of copied properties Adds copy/paste icons to theme Apply suggestions + Cache icons for editor section Fixes category property copy/paste issues Handle MultiNodeEdit paste for group/category Handle EditorDebuggerRemoteObjects paste for category Only allow copy/paste on the same category/section name
1e26692 to
17f942f
Compare
|
I think the feature is operational. However, it would be better to disable the paste buttons (like graying them out) if the clipboard doesn’t contain “@pastebin_category_name” or “@pastebin_section_name”, or if the category or section name doesn’t match. |
| } | ||
| } | ||
|
|
||
| if (category_name != pastebin_category_name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically unnecessary 🤔
Pasting into a different category will just assign matching properties, which might be useful sometimes.
| @@ -1410,7 +1350,11 @@ void EditorProperty::menu_option(int p_option) { | |||
| InspectorDock::get_inspector_singleton()->set_property_clipboard(object->get(property)); | |||
| } break; | |||
| case MENU_PASTE_VALUE: { | |||
| emit_changed(property, InspectorDock::get_inspector_singleton()->get_property_clipboard()); | |||
| const Dictionary clipboard = InspectorDock::get_inspector_singleton()->get_property_clipboard(); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Properties are copied as their actual value, not a Dictionary. You need to first check type of property clipboard.
| if (clipboard.has("@pastebin_category_name") || clipboard.has("@pastebin_section_name")) { | ||
| break; | ||
| } | ||
| emit_changed(property, clipboard); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the original value, not the forced Dictionary.

Fixes: godotengine/godot-proposals#13343
Screen.Recording.2025-10-10.025134.mp4