-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Implements "Batch Rename" editor tool. #15928
Conversation
editor/scene_tree_dock.cpp
Outdated
@@ -2032,6 +2043,10 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel | |||
add_child(create_dialog); | |||
create_dialog->connect("create", this, "_create"); | |||
|
|||
rename_dialog = memnew(RenameDialog(scene_tree, &editor_data->get_undo_redo())); | |||
add_child(rename_dialog); | |||
//rename_dialog->connect("confirmed", this, "_barename"); |
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.
Will get rid of the comment. Sorry.
Will need to address this:
|
Hum why not, the tool seems obviously useful but in quite rare and specific cases. |
Does this also rename node paths in gdscript? |
looks very useful!! |
Thanks for the feedback so far. @groud I will look into moving it. I hope that I can still use the shortcut/context menu entry with a PluginEditor. |
If it's a problem later on, we can make this possible :) |
de00988
to
d782424
Compare
d782424
to
e58b10c
Compare
Cleaned up minor issues, added translation strings, tooltips, fixed the build. I looked into the EditorPlugin. I think this mostly boils down to #6128 I am not sure about the regex. I'll leave it as expected behaviour. Not sure if under_score to CamelCase should be moved up to String class. Input welcome. The only important one I see is restoring the selection (which probably gets lost by the renaming itself). |
This seems fine to me, if @akien-mga approves, should be able to merge |
Thanks. I just checked it against the latest master. Seems to still work fine. |
Thanks, looks good! I also think it might be better eventually as an editor plugin, but there might indeed be some features missing from EditorPlugin to do it fully, and since it's a self contained class, it doesn't hurt to add it as is for now. |
Agreed, @akien-mga |
Adds a very flexible way to rename multiple nodes at once. I badly needed this in the past. Hope you like it, too.
This is too late for 3.0 so maybe for 3.1? It should be feature complete but please test and read the TODO items at the bottom. I wanted to have this here for discussion before polishing the minimal remaining items.
Long Demo
https://www.dropbox.com/s/wxvhhobk4cc6h9v/batch_rename_overview.mp4?dl=0
(If the mp4 does not work let me know and I try to make a smaller gif)
Features
For discussion / TODO
Not using translation strings yetMissing Tool tips (especially for the substitutions)Fix build (compare comment below)Just noticed I called it under_lined but godot calls it underscored. Will fix this.The dialog could be lazily loaded, however I did not want to make the code more complexRegEx behaves strange:In future when I have the time I would like to write a separate tool that sorts nodes based on attributes (E.g. X position, Z order, Name, Type etc.) which would work hand in hand with this tool.
Let me know what you think. Thanks.