Unsupported format encountered (obj) - QT3D Mesh
Solved
QML and Qt Quick
-
Hey Guys, im trying to load a custom mesh in qml with qt3d. Im using Qt5.10.
Now im getting an absolute strange error. The application says "Unsupported format encountered (obj)"
Project is with CMake and Visual Studio.Same obj file can be loaded with the same code in QtCreator Application.
Cant find anything in the internet regarding this topic.
Code below
import Qt3D.Core 2.0
import Qt3D.Input 2.0
import Qt3D.Extras 2.9
import Qt3D.Render 2.0Entity{ id: root property var pos property string meshSourcePath: "path/to/obj.obj" property color color: Qt.rgba(0.1,0.6,0,1) property var scale: Qt.vector3d(1,1,1) property double rotationDegreesAz property double rotationDegreenEl Mesh{ id: mesh source: root.meshSourcePath } Transform{ id: trans translation: pos rotationY: root.rotationDegreesAz scale3D: root.scale } PhongMaterial{ id:mat ambient: root.color shininess: 0.2 diffuse: ambient specular: ambient } ObjectPicker{ id: picker onClicked: { console.log("ObjectPicker: " + root.name) } } components: [mesh,trans,mat, picker] }
-
solved it.
had to copy "geometryloaders" from Qt5.10/plugins to the applicatoin directory. -
Hi,
Good catch ! I just remembered that there was an issue in earlier versions where the deployment tool didn't properly copy all the needed plugins. It has been fixed in between.