Show 3D model of GLB file in Qt window
-
Hi,
My requirement is to show 3D model of GLB file format in Qt window. I use QSceneLoader object to achieve it but I could only see blank window. I see following error in my application output :"Qt3D.Renderer.SceneLoaders: Qt3DCore::QEntity* Qt3DRender::Render::LoadSceneJob::tryLoadScene(Qt3DRender::QSceneLoader::Status&, const QStringList&, const std::function<void(Qt3DRender::QSceneImporter*)>&) Found no suitable importer plugin"
I read Qt documentation that QT framework uses "Open Asset Import Libray" (AssImp) to load 3D content. "AssImp" library supports GLB file format. I use Qt 6.5.2 version
I have pasted my code below. What am i missing ?
int main(int argc, char **argv)
{
QApplication app(argc, argv);
Qt3DExtras::Qt3DWindow *view = new3DExtras::Qt3DWindow();Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity(); Qt3DRender::QSceneLoader *loader = new Qt3DRender::QSceneLoader(rootEntity); QObject::connect(loader, &Qt3DRender::QSceneLoader::statusChanged, &app, [](Qt3DRender::QSceneLoader::Status s){qDebug() << s;}); QUrl url = QUrl::fromLocalFile("D:/Work/2023/gfem.glb"); loader->setSource(url); view->setRootEntity(rootEntity); view->show(); return app.exec();
}
-
Hi,
My requirement is to show 3D model of GLB file format in Qt window. I use QSceneLoader object to achieve it but I could only see blank window. I see following error in my application output :"Qt3D.Renderer.SceneLoaders: Qt3DCore::QEntity* Qt3DRender::Render::LoadSceneJob::tryLoadScene(Qt3DRender::QSceneLoader::Status&, const QStringList&, const std::function<void(Qt3DRender::QSceneImporter*)>&) Found no suitable importer plugin"
I read Qt documentation that QT framework uses "Open Asset Import Libray" (AssImp) to load 3D content. "AssImp" library supports GLB file format. I use Qt 6.5.2 version
I have pasted my code below. What am i missing ?
int main(int argc, char **argv)
{
QApplication app(argc, argv);
Qt3DExtras::Qt3DWindow *view = new3DExtras::Qt3DWindow();Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity(); Qt3DRender::QSceneLoader *loader = new Qt3DRender::QSceneLoader(rootEntity); QObject::connect(loader, &Qt3DRender::QSceneLoader::statusChanged, &app, [](Qt3DRender::QSceneLoader::Status s){qDebug() << s;}); QUrl url = QUrl::fromLocalFile("D:/Work/2023/gfem.glb"); loader->setSource(url); view->setRootEntity(rootEntity); view->show(); return app.exec();
}
@Sridharan said in Show 3D model of GLB file in Qt window:
Found no suitable importer plugin
Have you deployed the plugins to the machine running the program, or is this happening on your development machine?
Does the fileD:/Work/2023/gfem.glb
exist and does it contain a valid glTF binary file (loadable, for example, the gITF sample viewer). -
@Sridharan said in Show 3D model of GLB file in Qt window:
Found no suitable importer plugin
Have you deployed the plugins to the machine running the program, or is this happening on your development machine?
Does the fileD:/Work/2023/gfem.glb
exist and does it contain a valid glTF binary file (loadable, for example, the gITF sample viewer).Hi @ChrisW67 ,
Thanks for your reply. This happens in my development machine. Plugins like "assimpsceneimport.dll, gltfsceneexport.dll, gltfsceneimport.dll" are available in my QT installation.Also, my filepath exists. gfem.GLB file is valid and I could load the file in the viewer you have recommended.
I am using Qt open source version. Is Qt 3D available only for commercial version ?
Thanks,
Sridharan