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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -170,7 +170,7 @@ Node {
scale: Qt.vector3d(0.024, 0.024, 0.024) scale: Qt.vector3d(0.024, 0.024, 0.024)
materials: DefaultMaterial { materials: DefaultMaterial {
id: material id: material
emissiveColor: highlightOnHover diffuseColor: highlightOnHover
&& (centerMouseArea.hovering || centerMouseArea.dragging) && (centerMouseArea.hovering || centerMouseArea.dragging)
? Qt.lighter(Qt.rgba(0.5, 0.5, 0.5, 1)) ? Qt.lighter(Qt.rgba(0.5, 0.5, 0.5, 1))
: 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) scale: Qt.vector3d(0.020, 0.020, 0.020)
materials: DefaultMaterial { materials: DefaultMaterial {
id: material id: material
emissiveColor: scaleRod.color diffuseColor: scaleRod.color
lighting: DefaultMaterial.NoLighting lighting: DefaultMaterial.NoLighting
} }
} }

View File

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