-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.14.2, 5.15.0
-
None
Tried to change material color by ObjectPicker.containsMouse, but Scene3D didn't detect it if the renderPolicy is OnDemand.
The full QML code is attached.
// containsMouse changes, but the color never be updated if
// the renderPolicy is OnDemand.
DiffuseSpecularMaterial {
id: material
ambient: picker.containsMouse ? "red" : "blue"
},
ObjectPicker {
id: picker
hoverEnabled: true
onContainsMouseChanged: {
console.log("containsMouse:", containsMouse);
// If the change is not triggered within the current
// event loop, it works. Uncomment this to test the
// behavior.
Qt.callLater(() => {
//material.ambient = containsMouse ? "red" : "blue";
});
}
}
From my testing, Renderer::markDirty() is called after the change is detected and processed by Scene3DItem::onBeforeSync(). And I guess the dirty bits would be cleared by the next processFrame().
I'll send a PoC-level patch to address this issue.
| For Gerrit Dashboard: QTBUG-85681 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 308269,1 | Scene3D: Check shouldRender() state before calling processFrame() | dev | qt/qt3d | Status: NEW | 0 | 0 |