I am working on creating a change detection script for QGIS3, that detects the differences between two DEMs and highlights the changes. Everything is working well but I have been unable to get the 3D view to work using pyqgis, I have it working using the GUI.

I want to display my output rasters in 3D view using PyQGIS, like this:

enter image description here

I have looked into the 3D Library and the Python API but I have not been able to get any of this to work.

I tried using the Qgs3DmapScene Class but the QGIS python console does not recognize it.

How can I use the 3D View to display layers using PyQGIS? is there any example or sample of this somewhere?

I am using QGIS 3.4.4 on Windows with Qt 5.11.2


1 Answer 1


As of 3.28, this is not possible. The 3D code needs restructuring so that it can be used like other parts of the QGIS libraries.

See https://lists.osgeo.org/pipermail/qgis-developer/2022-November/065258.html and https://lists.osgeo.org/pipermail/qgis-developer/2022-November/065261.html for some context.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.