Video not visible when using QtQuick3D
-
Hello Folks,
I have trouble using QtQuick3D and Video from QtMultimedia together. When I activate QtQuick3D the video is not visible anymore. I am using Pyside2 5.15.1 on Mac OS 10.14.6
Does anyone know how to solve this problem? The problem occurs as soon as I set surface format on app start like:
fmt = QSurfaceFormat() fmt.setDepthBufferSize(24) fmt.setSamples(4) fmt.setStencilBufferSize(8) fmt.setVersion(4, 3) fmt.setProfile(QSurfaceFormat.CoreProfile) QSurfaceFormat.setDefaultFormat(fmt)
When I remove these lines, the video works fine, but then I can not use View3D anymore.
-
Hello Folks,
I have trouble using QtQuick3D and Video from QtMultimedia together. When I activate QtQuick3D the video is not visible anymore. I am using Pyside2 5.15.1 on Mac OS 10.14.6
Does anyone know how to solve this problem? The problem occurs as soon as I set surface format on app start like:
fmt = QSurfaceFormat() fmt.setDepthBufferSize(24) fmt.setSamples(4) fmt.setStencilBufferSize(8) fmt.setVersion(4, 3) fmt.setProfile(QSurfaceFormat.CoreProfile) QSurfaceFormat.setDefaultFormat(fmt)
When I remove these lines, the video works fine, but then I can not use View3D anymore.
Here is the missing qml part:
import QtQuick 2.15 import QtQuick3D 1.15 import QtQuick3D.Helpers 1.15 import QtMultimedia 5.15 Item { id: root_component anchors.fill: parent Video { anchors.fill: parent source: "assets/01_Animation_PTB.mp4" Component.onCompleted: { play() } } Item { // anchors.fill: parent width: 300 height: 200 View3D { id: view anchors.fill: parent environment: SceneEnvironment { clearColor: "skyblue" backgroundMode: SceneEnvironment.Color } PerspectiveCamera { position: Qt.vector3d(0, 200, 300) eulerRotation.x: -30 } DirectionalLight { eulerRotation.x: -30 eulerRotation.y: -70 } Model { position: Qt.vector3d(0, 150, 0) source: "#Sphere" materials: [ DefaultMaterial { diffuseMap: Texture { sourceItem: tester } } ] SequentialAnimation on y { loops: Animation.Infinite NumberAnimation { duration: 3000 to: -150 from: 150 easing.type:Easing.InQuad } NumberAnimation { duration: 3000 to: 150 from: -150 easing.type:Easing.OutQuad } } } } } }