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

[WIP] Copy Paste feature for Scene Tree Dock #19327

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 65 additions & 0 deletions editor/icons/icon_copy.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions editor/icons/icon_paste.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion editor/scene_tree_dock.cpp
Expand Up @@ -2684,4 +2684,4 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel

EDITOR_DEF("interface/editors/show_scene_tree_root_selection", true);
EDITOR_DEF("_use_favorites_root_selection", false);
}
}
6 changes: 6 additions & 0 deletions editor/scene_tree_dock.h
Expand Up @@ -68,6 +68,9 @@ class SceneTreeDock : public VBoxContainer {
TOOL_MOVE_UP,
TOOL_MOVE_DOWN,
TOOL_DUPLICATE,
TOOL_COPY,
TOOL_PASTE,
TOOL_PASTE_KGT,
TOOL_REPARENT,
TOOL_MAKE_ROOT,
TOOL_NEW_SCENE_FROM,
Expand Down Expand Up @@ -142,13 +145,16 @@ class SceneTreeDock : public VBoxContainer {
void _create();
Node *scene_root;
Node *edited_scene;
List<Node *> copied_nodes;
EditorNode *editor;

VBoxContainer *create_root_dialog;
String selected_favorite_root;

void _add_children_to_popup(Object *p_obj, int p_depth);

void _node_paste(List<Node *> p_selection, bool p_keep_global_xform);

void _node_reparent(NodePath p_path, bool p_keep_global_xform);
void _do_reparent(Node *p_new_parent, int p_position_in_parent, Vector<Node *> p_nodes, bool p_keep_global_xform);

Expand Down