Open WinnerWind opened 4 weeks ago
This isn't too hard to do in a plugin, I got a proof of concept working pretty quickly.
@tool
extends EditorPlugin
var second_inspector : EditorInspector
var scene_tree_context_menu_plugin : SceneTreeContextMenuPlugin
func _enter_tree() -> void:
second_inspector = EditorInspector.new()
scene_tree_context_menu_plugin = SceneTreeContextMenuPlugin.new()
scene_tree_context_menu_plugin.inspector = second_inspector
add_control_to_dock(DOCK_SLOT_LEFT_BL, second_inspector)
add_context_menu_plugin(EditorContextMenuPlugin.CONTEXT_SLOT_SCENE_TREE, scene_tree_context_menu_plugin)
func _exit_tree() -> void:
# Clean-up of the plugin goes here.
remove_control_from_docks(second_inspector)
remove_context_menu_plugin(scene_tree_context_menu_plugin)
second_inspector.queue_free()
class SceneTreeContextMenuPlugin extends EditorContextMenuPlugin:
var inspector : EditorInspector
func _popup_menu(paths: PackedStringArray) -> void:
var scene_root := EditorInterface.get_edited_scene_root()
var node := scene_root.get_node(paths[0])
add_context_menu_item("Edit in secondary inspector", inspector.edit.bind(node).unbind(1))
Note that unlike this proposal this stub can only open another node in the edited scene. Editing a resource from the filesystem would be an easy addition with another EditorContextMenuPlugin.
Editing a resource on a node currently open in the inspector would be trickier/hackier since you can't make an EditorContextMenuPlugin for the Inspector or the Resource context menu without resorting to some unsupported sneaky tricks, I think the easiest way to expose that functionality would be to make an EditorInspectorPlugin that patches in a button for every resource field but from there it's pretty easy.
Would need quite a bit more work to be a really useful plugin, might look into building one, but maybe this stub can help your workflow a bit. It'd be very easy to expand to having 2 or 3, although a plugin should probably allow an arbitrary number. Not hard to do code-wise but would take some thought on a reasonable workflow for supporting that.
EDIT: Also not sure why it's not as nice as the real Inspector. I would have expected the same headings/sections and category folding etc but I guess the real Inspector has a bit more to it than the EditorInspector class does.
This is quite good, but it feels kind of jittery and unstable to me. Ive had my editor crash a few times using this, but it's still quite good. Might re-work this into a usable plugin.
Describe the project you are working on
Hi! I'm working on a detective video game taking place on a desktop in a file system. Because of the nature of the game, It is vital for me to cross-reference information stored in other nodes to write the content of the one I am currently editing.
The game itself takes place on a fake toy operating system with a working file system (made of nodes) and multiple resources scattered all over the place (this is unavoidable, even with good coding practices)
Describe the problem or limitation you are having in your project
If I was writing in say Obsidian, what I would do in this case is to split the view horizontally/vertically and continue writing, or if I was accessing a system that didn't have a GUI (say SSH) I'd make multiple instances of the text editor all opening multiple files for me to refer to.
I often find myself opening the multiline string editor, only to then realize I need to refer another node, so I close the editor (losing the scroll point!) opening another node, viewing its properties, then going back to the original and working on it again. I hope you can see why this is very cumbersome.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
For the game, it would be nice if Godot would let certain windows be popped out (a feature that already exists) and then have multiple instances all editing different nodes (that doesn't exist. each window can only edit one node)
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The user could press a tiny popup button next to each editor panel/property which opens up a new window containing the entire node panel/just the contents of that property
If this enhancement will not be used often, can it be worked around with a few lines of script?
I don't think it can be worked around with a few lines of script as it could require fundamentally re-writing the editor. I am unfortunately not very knowledgeable on how the editor works.
One workaround is to open the godot editor twice, which is what i currently do, but massively increases my battery usage (I work on a laptop)
Is there a reason why this should be core and not an add-on in the asset library?
This is in regards to the editor.