QmlDesigner: Fix 3D overlay object colors

Recent changes to Quick3D changed how NoLighting materials work.
Emissive color no longer has effect in that case, so use diffuse color
instead.

Change-Id: Idde43f5bdf06a432a5dd06f9c52d6812fa790a73
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2020-08-04 10:19:24 +03:00
parent 9f2bb4abaf
commit 4d45e2defe
13 changed files with 20 additions and 20 deletions

View File

@@ -45,7 +45,7 @@ Node {
source: "meshes/axishelper.mesh"
materials: DefaultMaterial {
id: posMat
emissiveColor: posModel.hovering ? armRoot.hoverColor : armRoot.color
diffuseColor: posModel.hovering ? armRoot.hoverColor : armRoot.color
lighting: DefaultMaterial.NoLighting
}
pickable: true
@@ -62,7 +62,7 @@ Node {
scale: Qt.vector3d(0.025, 0.025, 0.025)
materials: DefaultMaterial {
id: negMat
emissiveColor: negModel.hovering ? armRoot.hoverColor : armRoot.color
diffuseColor: negModel.hovering ? armRoot.hoverColor : armRoot.color
lighting: DefaultMaterial.NoLighting
}
pickable: true

View File

@@ -48,7 +48,7 @@ Model {
materials: [
DefaultMaterial {
id: defaultMaterial
emissiveColor: cameraFrustum.selected ? "#FF0000" : "#555555"
diffuseColor: cameraFrustum.selected ? "#FF0000" : "#555555"
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
}

View File

@@ -31,7 +31,7 @@ Model {
id: rootModel
property View3D view3D
property alias color: material.emissiveColor
property alias color: material.diffuseColor
property Node targetNode: null
property bool dragging: mouseAreaYZ.dragging || mouseAreaXZ.dragging
property bool active: false
@@ -52,7 +52,7 @@ Model {
DefaultMaterial {
id: material
emissiveColor: "white"
diffuseColor: "white"
lighting: DefaultMaterial.NoLighting
}

View File

@@ -520,7 +520,7 @@ Item {
id: lineMat
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
emissiveColor: pivotLine.color
diffuseColor: pivotLine.color
}
]
}

View File

@@ -47,7 +47,7 @@ Node {
materials: [
DefaultMaterial {
id: mainGridMaterial
emissiveColor: "#aaaaaa"
diffuseColor: "#aaaaaa"
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
}
@@ -65,7 +65,7 @@ Node {
materials: [
DefaultMaterial {
id: subGridMaterial
emissiveColor: mainGridMaterial.emissiveColor
diffuseColor: mainGridMaterial.diffuseColor
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
}
@@ -82,7 +82,7 @@ Node {
materials: [
DefaultMaterial {
id: vCenterLineMaterial
emissiveColor: "#00a1d2"
diffuseColor: "#00a1d2"
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
}
@@ -99,7 +99,7 @@ Node {
materials: [
DefaultMaterial {
id: hCenterLineMaterial
emissiveColor: "#cb211a"
diffuseColor: "#cb211a"
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
}

View File

@@ -336,7 +336,7 @@ Node {
DefaultMaterial {
id: lightMaterial
emissiveColor: lightGizmo.color
diffuseColor: lightGizmo.color
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
}

View File

@@ -33,7 +33,7 @@ Node {
property alias startPos: lineGeometry.startPos
property alias endPos: lineGeometry.endPos
property alias name: lineGeometry.name // Name must be unique for each line
property alias color: lineMat.emissiveColor
property alias color: lineMat.diffuseColor
Model {
geometry: LineGeometry {

View File

@@ -31,7 +31,7 @@ Model {
id: rootModel
property View3D view3D
property alias color: gizmoMaterial.emissiveColor
property alias color: gizmoMaterial.diffuseColor
property alias priority: mouseArea.priority
property Node targetNode: null
property bool dragging: mouseArea.dragging
@@ -53,7 +53,7 @@ Model {
DefaultMaterial {
id: gizmoMaterial
emissiveColor: "white"
diffuseColor: "white"
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
}

View File

@@ -175,7 +175,7 @@ Node {
source: "#Sphere"
materials: DefaultMaterial {
id: material
emissiveColor: "black"
diffuseColor: "black"
opacity: mouseAreaFree.hovering ? 0.15 : 0
lighting: DefaultMaterial.NoLighting
}

View File

@@ -31,7 +31,7 @@ Model {
id: rotateRing
property View3D view3D
property alias color: material.emissiveColor
property alias color: material.diffuseColor
property Node targetNode: null
property bool dragging: mouseAreaMain.dragging
property bool active: false
@@ -60,7 +60,7 @@ Model {
materials: DefaultMaterial {
id: material
emissiveColor: "white"
diffuseColor: "white"
lighting: DefaultMaterial.NoLighting
}

View File

@@ -170,7 +170,7 @@ Node {
scale: Qt.vector3d(0.024, 0.024, 0.024)
materials: DefaultMaterial {
id: material
emissiveColor: highlightOnHover
diffuseColor: highlightOnHover
&& (centerMouseArea.hovering || centerMouseArea.dragging)
? Qt.lighter(Qt.rgba(0.5, 0.5, 0.5, 1))
: Qt.rgba(0.5, 0.5, 0.5, 1)

View File

@@ -44,7 +44,7 @@ DirectionalDraggable {
scale: Qt.vector3d(0.020, 0.020, 0.020)
materials: DefaultMaterial {
id: material
emissiveColor: scaleRod.color
diffuseColor: scaleRod.color
lighting: DefaultMaterial.NoLighting
}
}

View File

@@ -56,7 +56,7 @@ Node {
materials: [
DefaultMaterial {
emissiveColor: "#fff600"
diffuseColor: "#fff600"
lighting: DefaultMaterial.NoLighting
cullMode: Material.NoCulling
}