summaryrefslogtreecommitdiff
path: root/modules/gridmap/grid_map_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-13 12:19:30 +0200
committerGitHub <noreply@github.com>2021-09-13 12:19:30 +0200
commitdde48ebed6303b53a912005570179382e3bd250b (patch)
treefb4f30aa4376619a15d1b399d7c1e774d5e61dd4 /modules/gridmap/grid_map_editor_plugin.cpp
parent078bdef7e915503935d19e91017c60b772e9a6ff (diff)
parent70108fd8509a09230933872c3042a7c7ef2545b8 (diff)
Merge pull request #52298 from DeleteSystem32/meshlib-transform
implement individual mesh transform for meshlibrary items
Diffstat (limited to 'modules/gridmap/grid_map_editor_plugin.cpp')
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 2331a12d0f..c170bb107e 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -255,6 +255,12 @@ void GridMapEditor::_update_cursor_transform() {
cursor_transform.basis *= node->get_cell_scale();
cursor_transform = node->get_global_transform() * cursor_transform;
+ if (selected_palette >= 0) {
+ if (node && !node->get_mesh_library().is_null()) {
+ cursor_transform *= node->get_mesh_library()->get_item_mesh_transform(selected_palette);
+ }
+ }
+
if (cursor_instance.is_valid()) {
RenderingServer::get_singleton()->instance_set_transform(cursor_instance, cursor_transform);
RenderingServer::get_singleton()->instance_set_visible(cursor_instance, cursor_visible);