Reputation: 11
I am using Qt6.5.2. My expectation is to load GLB file and render it in Qt window. As per Qt documentation for QSceneLoader class, QT supports GLB file but on loading GLB file in my Qt application, I get the following error,
Qt3D.Renderer.SceneLoaders: class Qt3DCore::QEntity *__cdecl Qt3DRender::Render::LoadSceneJob::tryLoadScene(enum Qt3DRender::QSceneLoader::Status &,const class QList &,const class std::function<void __cdecl(class Qt3DRender::QSceneImporter *)> &) Found no suitable importer plugin for QUrl("file:///D:/Work/2023/Box.glb")
I have checked in my QT installation path. Plugins like assimpsceneimport.dll, gltfsceneexport.dll, gltfsceneimport.dll are available.
I am able to load and render '.dae' files, it works expected for below code. But, on loading '.glb' file, I get 'Found no suitable importer' error. I have tried in 3d models in both gltf 1.0 and gltf 2.0 version but I get same error.
int main(int ac, char **av)
{
QApplication app(ac, av);
Qt3DExtras::Qt3DWindow view;
view.defaultFrameGraph()->setClearColor(Qt::black);
// Root entity
Qt3DCore::QEntity *sceneRoot = new Qt3DCore::QEntity();
// Scene camera set here
// Scene loader
Qt3DCore::QEntity *sceneLoaderEntity = new Qt3DCore::QEntity(sceneRoot);
Qt3DRender::QSceneLoader *sceneLoader = new Qt3DRender::QSceneLoader(sceneLoaderEntity);
sceneLoaderEntity->addComponent(sceneLoader);
QUrl sourceFileName = QUrl::fromLocalFile("D:/Work/2023/Box.glb");
sceneLoader->setSource(sourceFileName);
view.setRootEntity(sceneRoot);
view.show();
return app.exec();
}
Upvotes: 0
Views: 444
Reputation: 2843
The glb-format is currenty supported by asssimp on the latest master. I am not sure which verion is in use for the Qt-plugin. If the importer does not work you could try to get the latest assimp-master and load your files with that. If they are working the provided assimp-lib used by Qt is outdated. if not, the files could be invalid.
Upvotes: 1