summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-10 12:08:51 +0200
committerGitHub <noreply@github.com>2020-04-10 12:08:51 +0200
commit60f77fa059119ab4ac2eb60885ed88980912d844 (patch)
tree7f4dcba01e1c3863a75b974b6f503a0900f1eeed /editor
parent5566c5eb8dc7117e1bc2d16667f1a37d794fccdb (diff)
parent48b144afb7c91b1156e5aad091fd41de4eb88657 (diff)
Merge pull request #37509 from wazzy47/issue_36228
Add "preview_on_sphere" setting of material editor plugin
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/material_editor_plugin.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index 00e8a05e4e..eb14495b9c 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -95,6 +95,7 @@ void MaterialEditor::_button_pressed(Node *p_button) {
sphere_instance->hide();
box_switch->set_pressed(true);
sphere_switch->set_pressed(false);
+ EditorSettings::get_singleton()->set_project_metadata("inspector_options", "material_preview_on_sphere", false);
}
if (p_button == sphere_switch) {
@@ -102,6 +103,7 @@ void MaterialEditor::_button_pressed(Node *p_button) {
sphere_instance->show();
box_switch->set_pressed(false);
sphere_switch->set_pressed(true);
+ EditorSettings::get_singleton()->set_project_metadata("inspector_options", "material_preview_on_sphere", true);
}
}
@@ -155,7 +157,6 @@ MaterialEditor::MaterialEditor() {
sphere_instance->set_mesh(sphere_mesh);
box_mesh.instance();
box_instance->set_mesh(box_mesh);
- box_instance->hide();
set_custom_minimum_size(Size2(1, 150) * EDSCALE);
@@ -194,6 +195,15 @@ MaterialEditor::MaterialEditor() {
light_2_switch->connect("pressed", callable_mp(this, &MaterialEditor::_button_pressed), varray(light_2_switch));
first_enter = true;
+
+ if (EditorSettings::get_singleton()->get_project_metadata("inspector_options", "material_preview_on_sphere", true)) {
+ box_instance->hide();
+ } else {
+ box_instance->show();
+ sphere_instance->hide();
+ box_switch->set_pressed(true);
+ sphere_switch->set_pressed(false);
+ }
}
///////////////////////