Show shader editor on shader compilation error#112954
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
48d8ba1 to
8ab246f
Compare
8ab246f to
1b21548
Compare
KoBeWi
left a comment
There was a problem hiding this comment.
Seems to work correctly.
The debugger changes need review from someone more familiar with the debugger.
| ScriptEditorPlugin *script_editor = Object::cast_to<ScriptEditorPlugin>(EditorNode::get_editor_data().get_editor_by_name("Script")); | ||
| ShaderEditorPlugin *shader_editor = Object::cast_to<ShaderEditorPlugin>(EditorNode::get_editor_data().get_editor_by_name("Shader")); |
There was a problem hiding this comment.
This is super hacky. Ideally these plugins should have exposed singletons.
Alternatively, it would be better if you at least fetched the plugins once, e.g. in NOTIFICATION_READY. And also add ERR_FAIL_NULL/DEV_ASSERT to check if they exist.
There was a problem hiding this comment.
I added singletons to the plugin classes.
Also I was wondering, this is used in a similar way in other locations. What is the difference or should they also be changed?
godot/editor/script/script_editor_plugin.cpp
Line 3600 in 20d58a3
| InspectorDock::get_singleton()->edit_resource(res); | ||
| // If no line is specified, only open the file. |
There was a problem hiding this comment.
Editing something in the inspector does not open the relevant editor.
There was a problem hiding this comment.
Without this line the editor does not switch to the Shader Editor. I tried this by being on the Output dock and reloading the project with a broken shader attached to a node in a open scene. But I just found out that this basically just calls EditorNode::get_singleton()->push_item(res.ptr()) which also works. I will use that instead
bdb1eba to
2f9d4ef
Compare
1f1fb4e to
885b391
Compare
885b391 to
8263575
Compare
8263575 to
9c2d8ab
Compare
9c2d8ab to
d36bf47
Compare
d36bf47 to
1d8c848
Compare
1d8c848 to
a9fe1ab
Compare
Goals:
What I tested:
Note: I also edited _meta_clicked which is not directly related to the issue but I used that code for inspiration and found it to cause errors when opening shader files and replaced it with my solution. If unwanted I will revert this and can open an extra PR.