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
|
id: root
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
environment: sceneEnv
|
environment: sceneEnv
|
||||||
camera: envMode === "SkyBox" && envValue === "preview_studio" ? studioCamera : defaultCamera
|
camera: !envMode || (envMode === "SkyBox" && envValue === "preview_studio") ? studioCamera
|
||||||
|
: defaultCamera
|
||||||
|
|
||||||
property Material previewMaterial
|
property Material previewMaterial
|
||||||
property string envMode
|
property string envMode
|
||||||
@@ -46,15 +47,16 @@ View3D {
|
|||||||
antialiasingMode: SceneEnvironment.MSAA
|
antialiasingMode: SceneEnvironment.MSAA
|
||||||
antialiasingQuality: SceneEnvironment.High
|
antialiasingQuality: SceneEnvironment.High
|
||||||
backgroundMode: envMode === "Color" ? SceneEnvironment.Color
|
backgroundMode: envMode === "Color" ? SceneEnvironment.Color
|
||||||
: envMode === "SkyBox" ? SceneEnvironment.SkyBox
|
: envMode === "Basic" ? SceneEnvironment.Transparent
|
||||||
: SceneEnvironment.Transparent
|
: SceneEnvironment.SkyBox
|
||||||
clearColor: envMode === "Color" ? envValue : "#000000"
|
clearColor: envMode === "Color" ? envValue : "#000000"
|
||||||
lightProbe: envMode === "SkyBox" ? skyBoxTex : null
|
lightProbe: !envMode || envMode === "SkyBox" ? skyBoxTex : null
|
||||||
|
|
||||||
Texture {
|
Texture {
|
||||||
id: skyBoxTex
|
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 {
|
DirectionalLight {
|
||||||
eulerRotation.x: -26
|
eulerRotation.x: -26
|
||||||
eulerRotation.y: modelSrc === "#Cube" ? -10 : -50
|
eulerRotation.y: modelSrc === "#Cube" ? -10 : -50
|
||||||
brightness: envMode !== "SkyBox" ? 1 : 0
|
brightness: envMode && envMode !== "SkyBox" ? 1 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
PerspectiveCamera {
|
PerspectiveCamera {
|
||||||
@@ -106,7 +108,7 @@ View3D {
|
|||||||
scale.y: 8
|
scale.y: 8
|
||||||
scale.x: 8
|
scale.x: 8
|
||||||
eulerRotation.x: -60
|
eulerRotation.x: -60
|
||||||
visible: !envMode || envMode === "Default"
|
visible: envMode === "Basic"
|
||||||
materials: floorMaterial
|
materials: floorMaterial
|
||||||
DefaultMaterial {
|
DefaultMaterial {
|
||||||
id: floorMaterial
|
id: floorMaterial
|
||||||
|
@@ -111,8 +111,8 @@ Column {
|
|||||||
ListModel {
|
ListModel {
|
||||||
id: envMenuModel
|
id: envMenuModel
|
||||||
ListElement {
|
ListElement {
|
||||||
envName: qsTr("Default")
|
envName: qsTr("Basic")
|
||||||
envStr: "Default"
|
envStr: "Basic"
|
||||||
}
|
}
|
||||||
ListElement {
|
ListElement {
|
||||||
envName: qsTr("Color")
|
envName: qsTr("Color")
|
||||||
|
@@ -647,12 +647,12 @@ void MaterialEditorView::initPreviewData()
|
|||||||
QString env = rootModelNode().auxiliaryData("matPrevEnv").toString();
|
QString env = rootModelNode().auxiliaryData("matPrevEnv").toString();
|
||||||
QString envValue = rootModelNode().auxiliaryData("matPrevEnvValue").toString();
|
QString envValue = rootModelNode().auxiliaryData("matPrevEnvValue").toString();
|
||||||
QString modelStr = rootModelNode().auxiliaryData("matPrevModel").toString();
|
QString modelStr = rootModelNode().auxiliaryData("matPrevModel").toString();
|
||||||
if (!envValue.isEmpty() && env != "Color" && env != "Default") {
|
if (!envValue.isEmpty() && env != "Color" && env != "Basic") {
|
||||||
env += '=';
|
env += '=';
|
||||||
env += envValue;
|
env += envValue;
|
||||||
}
|
}
|
||||||
if (env.isEmpty())
|
if (env.isEmpty())
|
||||||
env = "Default";
|
env = "SkyBox=preview_studio";
|
||||||
if (modelStr.isEmpty())
|
if (modelStr.isEmpty())
|
||||||
modelStr = "#Sphere";
|
modelStr = "#Sphere";
|
||||||
m_initializingPreviewData = true;
|
m_initializingPreviewData = true;
|
||||||
|
Reference in New Issue
Block a user