summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_track_editor.cpp4
-rw-r--r--editor/import/scene_import_settings.cpp17
-rw-r--r--editor/import/scene_import_settings.h2
-rw-r--r--editor/project_manager.cpp4
4 files changed, 22 insertions, 5 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 8426dfd1ac..3233bd79d5 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -2228,7 +2228,7 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool
if (i > 0) {
text += ", ";
}
- text += String(args[i]);
+ text += args[i].get_construct_string();
}
text += ")";
@@ -2540,7 +2540,7 @@ String AnimationTrackEdit::get_tooltip(const Point2 &p_pos) const {
if (i > 0) {
text += ", ";
}
- text += String(args[i]);
+ text += args[i].get_construct_string();
}
text += ")\n";
diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp
index 8d26feebf4..6eebb84216 100644
--- a/editor/import/scene_import_settings.cpp
+++ b/editor/import/scene_import_settings.cpp
@@ -64,6 +64,11 @@ class SceneImportSettingsData : public Object {
current[p_name] = p_value;
+ // SceneImportSettings must decide if a new collider should be generated or not
+ if (category == ResourceImporterScene::INTERNAL_IMPORT_CATEGORY_MESH_3D_NODE) {
+ SceneImportSettings::get_singleton()->request_generate_collider();
+ }
+
if (SceneImportSettings::get_singleton()->is_editing_animation()) {
if (category == ResourceImporterScene::INTERNAL_IMPORT_CATEGORY_MAX) {
if (ResourceImporterScene::get_animation_singleton()->get_option_visibility(path, p_name, current)) {
@@ -420,9 +425,9 @@ void SceneImportSettings::_update_view_gizmos() {
return;
}
for (const KeyValue<String, NodeData> &e : node_map) {
- bool generate_collider = false;
+ bool show_collider_view = false;
if (e.value.settings.has(SNAME("generate/physics"))) {
- generate_collider = e.value.settings[SNAME("generate/physics")];
+ show_collider_view = e.value.settings[SNAME("generate/physics")];
}
MeshInstance3D *mesh_node = Object::cast_to<MeshInstance3D>(e.value.node);
@@ -436,7 +441,7 @@ void SceneImportSettings::_update_view_gizmos() {
CRASH_COND_MSG(descendants.is_empty(), "This is unreachable, since the collider view is always created even when the collision is not used! If this is triggered there is a bug on the function `_fill_scene`.");
MeshInstance3D *collider_view = static_cast<MeshInstance3D *>(descendants[0].operator Object *());
- collider_view->set_visible(generate_collider);
+ collider_view->set_visible(show_collider_view);
if (generate_collider) {
// This collider_view doesn't have a mesh so we need to generate a new one.
@@ -466,6 +471,8 @@ void SceneImportSettings::_update_view_gizmos() {
collider_view->set_transform(transform);
}
}
+
+ generate_collider = false;
}
void SceneImportSettings::_update_camera() {
@@ -530,6 +537,10 @@ void SceneImportSettings::_load_default_subresource_settings(HashMap<StringName,
}
}
+void SceneImportSettings::request_generate_collider() {
+ generate_collider = true;
+}
+
void SceneImportSettings::update_view() {
update_view_timer->start();
}
diff --git a/editor/import/scene_import_settings.h b/editor/import/scene_import_settings.h
index 6481221ad6..69bf58b627 100644
--- a/editor/import/scene_import_settings.h
+++ b/editor/import/scene_import_settings.h
@@ -191,6 +191,7 @@ class SceneImportSettings : public ConfirmationDialog {
void _load_default_subresource_settings(HashMap<StringName, Variant> &settings, const String &p_type, const String &p_import_id, ResourceImporterScene::InternalImportCategory p_category);
bool editing_animation = false;
+ bool generate_collider = false;
Timer *update_view_timer = nullptr;
@@ -199,6 +200,7 @@ protected:
public:
bool is_editing_animation() const { return editing_animation; }
+ void request_generate_collider();
void update_view();
void open_settings(const String &p_path, bool p_for_animation = false);
static SceneImportSettings *get_singleton();
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 6c7ad259ea..5d66be3853 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -510,6 +510,8 @@ private:
ProjectSettings::CustomMap initial_settings;
// Be sure to change this code if/when renderers are changed.
+ // Default values are "forward_plus" for the main setting, "mobile" for the mobile override,
+ // and "gl_compatibility" for the web override.
String renderer_type = renderer_button_group->get_pressed_button()->get_meta(SNAME("rendering_method"));
initial_settings["rendering/renderer/rendering_method"] = renderer_type;
@@ -522,6 +524,8 @@ private:
project_features.push_back("Mobile");
} else if (renderer_type == "gl_compatibility") {
project_features.push_back("GL Compatibility");
+ // Also change the default rendering method for the mobile override.
+ initial_settings["rendering/renderer/rendering_method.mobile"] = "gl_compatibility";
} else {
WARN_PRINT("Unknown renderer type. Please report this as a bug on GitHub.");
}