forked from qt-creator/qt-creator
QmlDesigner: Change default material preview env to studio env
Since "Default" option is no longer default, it was changed to "Basic"
Change-Id: I8654efbd98fe62f6c4817141fc8559757f5e58e8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
(cherry picked from commit 3e17d8eed4
)
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
1bfd078071
commit
cb18ad80ae
@@ -29,7 +29,8 @@ View3D {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
environment: sceneEnv
|
||||
camera: envMode === "SkyBox" && envValue === "preview_studio" ? studioCamera : defaultCamera
|
||||
camera: !envMode || (envMode === "SkyBox" && envValue === "preview_studio") ? studioCamera
|
||||
: defaultCamera
|
||||
|
||||
property Material previewMaterial
|
||||
property string envMode
|
||||
@@ -46,15 +47,16 @@ View3D {
|
||||
antialiasingMode: SceneEnvironment.MSAA
|
||||
antialiasingQuality: SceneEnvironment.High
|
||||
backgroundMode: envMode === "Color" ? SceneEnvironment.Color
|
||||
: envMode === "SkyBox" ? SceneEnvironment.SkyBox
|
||||
: SceneEnvironment.Transparent
|
||||
: envMode === "Basic" ? SceneEnvironment.Transparent
|
||||
: SceneEnvironment.SkyBox
|
||||
clearColor: envMode === "Color" ? envValue : "#000000"
|
||||
lightProbe: envMode === "SkyBox" ? skyBoxTex : null
|
||||
lightProbe: !envMode || envMode === "SkyBox" ? skyBoxTex : null
|
||||
|
||||
Texture {
|
||||
id: skyBoxTex
|
||||
source: envMode === "SkyBox" ? "../images/" + envValue + ".hdr"
|
||||
: ""
|
||||
source: !envMode ? "../images/preview_studio.hdr"
|
||||
: envMode === "SkyBox" ? "../images/" + envValue + ".hdr"
|
||||
: ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +64,7 @@ View3D {
|
||||
DirectionalLight {
|
||||
eulerRotation.x: -26
|
||||
eulerRotation.y: modelSrc === "#Cube" ? -10 : -50
|
||||
brightness: envMode !== "SkyBox" ? 1 : 0
|
||||
brightness: envMode && envMode !== "SkyBox" ? 1 : 0
|
||||
}
|
||||
|
||||
PerspectiveCamera {
|
||||
@@ -106,7 +108,7 @@ View3D {
|
||||
scale.y: 8
|
||||
scale.x: 8
|
||||
eulerRotation.x: -60
|
||||
visible: !envMode || envMode === "Default"
|
||||
visible: envMode === "Basic"
|
||||
materials: floorMaterial
|
||||
DefaultMaterial {
|
||||
id: floorMaterial
|
||||
|
@@ -111,8 +111,8 @@ Column {
|
||||
ListModel {
|
||||
id: envMenuModel
|
||||
ListElement {
|
||||
envName: qsTr("Default")
|
||||
envStr: "Default"
|
||||
envName: qsTr("Basic")
|
||||
envStr: "Basic"
|
||||
}
|
||||
ListElement {
|
||||
envName: qsTr("Color")
|
||||
|
@@ -647,12 +647,12 @@ void MaterialEditorView::initPreviewData()
|
||||
QString env = rootModelNode().auxiliaryData("matPrevEnv").toString();
|
||||
QString envValue = rootModelNode().auxiliaryData("matPrevEnvValue").toString();
|
||||
QString modelStr = rootModelNode().auxiliaryData("matPrevModel").toString();
|
||||
if (!envValue.isEmpty() && env != "Color" && env != "Default") {
|
||||
if (!envValue.isEmpty() && env != "Color" && env != "Basic") {
|
||||
env += '=';
|
||||
env += envValue;
|
||||
}
|
||||
if (env.isEmpty())
|
||||
env = "Default";
|
||||
env = "SkyBox=preview_studio";
|
||||
if (modelStr.isEmpty())
|
||||
modelStr = "#Sphere";
|
||||
m_initializingPreviewData = true;
|
||||
|
Reference in New Issue
Block a user