diff options
-rw-r--r-- | doc/classes/EditorFileSystem.xml | 12 | ||||
-rw-r--r-- | editor/editor_file_system.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 18 | ||||
-rw-r--r-- | main/main.cpp | 6 | ||||
-rw-r--r-- | misc/dist/shell/_godot.zsh-completion | 4 | ||||
-rw-r--r-- | misc/dist/shell/godot.bash-completion | 2 | ||||
-rw-r--r-- | misc/dist/shell/godot.fish | 4 |
7 files changed, 35 insertions, 12 deletions
diff --git a/doc/classes/EditorFileSystem.xml b/doc/classes/EditorFileSystem.xml index 300cb4bfd6..60ac499d25 100644 --- a/doc/classes/EditorFileSystem.xml +++ b/doc/classes/EditorFileSystem.xml @@ -42,6 +42,15 @@ Returns [code]true[/code] of the filesystem is being scanned. </description> </method> + <method name="reimport_files"> + <return type="void" /> + <argument index="0" name="files" type="PackedStringArray" /> + <description> + Reimports a set of files. Call this if these files or their [code].import[/code] files were directly edited by script or an external program. + If the file type changed or the file was newly created, use [method update_file] or [method scan]. + [b]Note:[/b] This function blocks until the import is finished. However, the main loop iteration, including timers and [method Node._process], will occur during the import process due to progress bar updates. Avoid calls to [method reimport_files] or [method scan] while an import is in progress. + </description> + </method> <method name="scan"> <return type="void" /> <description> @@ -58,7 +67,8 @@ <return type="void" /> <argument index="0" name="path" type="String" /> <description> - Update a file information. Call this if an external program (not Godot) modified the file. + Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program. + This will not import the file. To reimport, call [method reimport_files] or [method scan] methods. </description> </method> <method name="update_script_classes"> diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 36ac9afca8..56edb03184 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -2372,6 +2372,7 @@ void EditorFileSystem::_bind_methods() { ClassDB::bind_method(D_METHOD("get_filesystem_path", "path"), &EditorFileSystem::get_filesystem_path); ClassDB::bind_method(D_METHOD("get_file_type", "path"), &EditorFileSystem::get_file_type); ClassDB::bind_method(D_METHOD("update_script_classes"), &EditorFileSystem::update_script_classes); + ClassDB::bind_method(D_METHOD("reimport_files", "files"), &EditorFileSystem::reimport_files); ADD_SIGNAL(MethodInfo("filesystem_changed")); ADD_SIGNAL(MethodInfo("sources_changed", PropertyInfo(Variant::BOOL, "exist"))); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 54408e953e..a7e3d17fdc 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -562,7 +562,11 @@ void CanvasItemEditor::_expand_encompassing_rect_using_children(Rect2 &r_rect, c } if (canvas_item && canvas_item->is_visible_in_tree() && (include_locked_nodes || !_is_node_locked(canvas_item))) { - Transform2D xform = p_parent_xform * p_canvas_xform * canvas_item->get_transform(); + Transform2D xform = p_canvas_xform; + if (!canvas_item->is_set_as_top_level()) { + xform *= p_parent_xform; + } + xform *= canvas_item->get_transform(); Rect2 rect = canvas_item->_edit_get_rect(); if (r_first) { r_rect = Rect2(xform.xform(rect.get_center()), Size2()); @@ -608,7 +612,11 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no } if (canvas_item && canvas_item->is_visible_in_tree()) { - Transform2D xform = (p_parent_xform * p_canvas_xform * canvas_item->get_transform()).affine_inverse(); + Transform2D xform = p_canvas_xform; + if (!canvas_item->is_set_as_top_level()) { + xform *= p_parent_xform; + } + xform = (xform * canvas_item->get_transform()).affine_inverse(); const real_t local_grab_distance = xform.basis_xform(Vector2(grab_distance, 0)).length() / zoom; if (canvas_item->_edit_is_selected_on_click(xform.xform(p_pos), local_grab_distance)) { Node2D *node = Object::cast_to<Node2D>(canvas_item); @@ -698,7 +706,11 @@ void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_n } if (canvas_item && canvas_item->is_visible_in_tree() && !locked && editable) { - Transform2D xform = p_parent_xform * p_canvas_xform * canvas_item->get_transform(); + Transform2D xform = p_canvas_xform; + if (!canvas_item->is_set_as_top_level()) { + xform *= p_parent_xform; + } + xform *= canvas_item->get_transform(); if (canvas_item->_edit_use_rect()) { Rect2 rect = canvas_item->_edit_get_rect(); diff --git a/main/main.cpp b/main/main.cpp index 7e80448d89..b1aee3f60a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -342,9 +342,9 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" -b, --breakpoints Breakpoint list as source::line comma-separated pairs, no spaces (use %%20 instead).\n"); OS::get_singleton()->print(" --profiling Enable profiling in the script debugger.\n"); OS::get_singleton()->print(" --gpu-profile Show a GPU profile of the tasks that took the most time during frame rendering.\n"); - OS::get_singleton()->print(" --vk-layers Enable Vulkan validation layers for debugging.\n"); + OS::get_singleton()->print(" --gpu-validation Enable graphics API validation layers for debugging.\n"); #if DEBUG_ENABLED - OS::get_singleton()->print(" --gpu-abort Abort on GPU errors (usually validation layer errors), may help see the problem if your system freezes.\n"); + OS::get_singleton()->print(" --gpu-abort Abort on graphics API usage errors (usually validation layer errors). May help see the problem if your system freezes.\n"); #endif OS::get_singleton()->print(" --remote-debug <uri> Remote debug (<protocol>://<host/IP>[:<port>], e.g. tcp://127.0.0.1:6007).\n"); #if defined(DEBUG_ENABLED) @@ -831,7 +831,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Missing GPU index argument, aborting.\n"); goto error; } - } else if (I->get() == "--vk-layers") { + } else if (I->get() == "--gpu-validation") { Engine::singleton->use_validation_layers = true; #ifdef DEBUG_ENABLED } else if (I->get() == "--gpu-abort") { diff --git a/misc/dist/shell/_godot.zsh-completion b/misc/dist/shell/_godot.zsh-completion index aaa5fe0a06..6444ca337e 100644 --- a/misc/dist/shell/_godot.zsh-completion +++ b/misc/dist/shell/_godot.zsh-completion @@ -61,8 +61,8 @@ _arguments \ '(-b --breakpoints)'{-b,--breakpoints}'[specify the breakpoint list as source::line comma-separated pairs, no spaces (use %20 instead)]:breakpoint list' \ '--profiling[enable profiling in the script debugger]' \ '--gpu-profile[show a GPU profile of the tasks that took the most time during frame rendering]' \ - '--vk-layers[enable Vulkan validation layers for debugging]' \ - '--gpu-abort[abort on GPU errors (usually validation layer errors)]' \ + '--gpu-validation[enable graphics API validation layers for debugging]' \ + '--gpu-abort[abort on graphics API usage errors (usually validation layer errors)]' \ '--remote-debug[enable remote debugging]:remote debugger address' \ '--debug-collisions[show collision shapes when running the scene]' \ '--debug-navigation[show navigation polygons when running the scene]' \ diff --git a/misc/dist/shell/godot.bash-completion b/misc/dist/shell/godot.bash-completion index 7927d26171..31e067e29a 100644 --- a/misc/dist/shell/godot.bash-completion +++ b/misc/dist/shell/godot.bash-completion @@ -64,7 +64,7 @@ _complete_godot_options() { --breakpoints --profiling --gpu-profile ---vk-layers +--gpu-validation --gpu-abort --remote-debug --debug-collisions diff --git a/misc/dist/shell/godot.fish b/misc/dist/shell/godot.fish index c05aa74017..da4ce1190c 100644 --- a/misc/dist/shell/godot.fish +++ b/misc/dist/shell/godot.fish @@ -74,8 +74,8 @@ complete -c godot -s d -l debug -d "Debug (local stdout debugger)" complete -c godot -s b -l breakpoints -d "Specify the breakpoint list as source::line comma-separated pairs, no spaces (use %20 instead)" -x complete -c godot -l profiling -d "Enable profiling in the script debugger" complete -c godot -l gpu-profile -d "Show a GPU profile of the tasks that took the most time during frame rendering" -complete -c godot -l vk-layers -d "Enable Vulkan validation layers for debugging" -complete -c godot -l gpu-abort -d "Abort on GPU errors (usually validation layer errors)" +complete -c godot -l gpu-validation -d "Enable graphics API validation layers for debugging" +complete -c godot -l gpu-abort -d "Abort on graphics API usage errors (usually validation layer errors)" complete -c godot -l remote-debug -d "Enable remote debugging" complete -c godot -l debug-collisions -d "Show collision shapes when running the scene" complete -c godot -l debug-navigation -d "Show navigation polygons when running the scene" |