summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_themes.cpp1
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp22
2 files changed, 18 insertions, 5 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index c589a3c042..723499ca9a 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -692,6 +692,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_color_hover", "PopupMenu", font_color_hl);
theme->set_color("font_color_accel", "PopupMenu", font_color_disabled);
theme->set_color("font_color_disabled", "PopupMenu", font_color_disabled);
+ theme->set_color("font_color_separator", "PopupMenu", font_color_disabled);
theme->set_icon("checked", "PopupMenu", theme->get_icon("GuiChecked", "EditorIcons"));
theme->set_icon("unchecked", "PopupMenu", theme->get_icon("GuiUnchecked", "EditorIcons"));
theme->set_icon("radio_checked", "PopupMenu", theme->get_icon("GuiRadioChecked", "EditorIcons"));
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 8f2fc968e3..6493e0f953 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -5826,13 +5826,25 @@ void Node3DEditor::snap_selected_nodes_to_floor() {
Set<CollisionShape3D *> cs = _get_child_nodes<CollisionShape3D>(sp);
if (cs.size()) {
- AABB aabb = sp->get_global_transform().xform(cs.front()->get()->get_shape()->get_debug_mesh()->get_aabb());
+ AABB aabb;
+ bool found_valid_shape = false;
+ if (cs.front()->get()->get_shape().is_valid()) {
+ aabb = sp->get_global_transform().xform(cs.front()->get()->get_shape()->get_debug_mesh()->get_aabb());
+ found_valid_shape = true;
+ }
for (Set<CollisionShape3D *>::Element *I = cs.front(); I; I = I->next()) {
- aabb.merge_with(sp->get_global_transform().xform(I->get()->get_shape()->get_debug_mesh()->get_aabb()));
+ if (I->get()->get_shape().is_valid()) {
+ aabb.merge_with(sp->get_global_transform().xform(I->get()->get_shape()->get_debug_mesh()->get_aabb()));
+ found_valid_shape = true;
+ }
+ }
+ if (found_valid_shape) {
+ Vector3 size = aabb.size * Vector3(0.5, 0.0, 0.5);
+ from = aabb.position + size;
+ position_offset.y = from.y - sp->get_global_transform().origin.y;
+ } else {
+ from = sp->get_global_transform().origin;
}
- Vector3 size = aabb.size * Vector3(0.5, 0.0, 0.5);
- from = aabb.position + size;
- position_offset.y = from.y - sp->get_global_transform().origin.y;
} else if (vi.size()) {
AABB aabb = vi.front()->get()->get_transformed_aabb();
for (Set<VisualInstance3D *>::Element *I = vi.front(); I; I = I->next()) {