QtQuick3D balsam import creates invalid mesh data

61 views Asked by At

I want to use use a .obj file within a View3D QML type. Therefore I use balsam to convert it and add the output to the resources.qrc file. To keep it simple I only use one of the meshes like:

Model {
            source: "../Models/boat.mesh"
            position: Qt.vector3d(0, -200, 0)
            scale: Qt.vector3d(200, 200, 200)
            materials: [
                            PrincipledMaterial {
                                baseColor: "#41cd52"
                                metalness: 0.0
                                roughness: 0.1
                                opacity: 1.0
                            }
            ]
        }

Unfortunately, the application does not display the model and print following error to log:

Mesh data invalid
Mesh data invalid
QSSG.warning: Failed to load mesh: :/Models/boat.mesh

The QML code above should be good, since it runs fine with the teapot.mesh from one of the Qt examples.

Additionally, I import the .obj file to Qt Design Studio without any problems. The model is displayed as expected even in the application preview. But after exporting it to a CMAKE project and running it from QtCreator, it leads to the same issue as described above.

Of course I've checked different .obj files resulting in the same issue. Therefore I suspect there is something wrong with the balsam tool e.g. parameter, version, etc..

1

There are 1 answers

0
user23463715 On

Version mismatch between Qt and balsam tool! It is required to use use the balsam tool from the used Qt version otherwise the fileVersion within the .mesh file is considered as invalid.