在Qt3D中导入对象不起作用,但是没有错误消息 [英] Importing objects in Qt3D doesn't work but there's not error message

查看:194
本文介绍了在Qt3D中导入对象不起作用,但是没有错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Qt3D应用程序,可以导入STL文件格式:

I have a Qt3D application which imports STL file formats:

m_sceneLoaderEntity = new Qt3DCore::QEntity();
m_sceneLoaderEntity->setObjectName("New imported entity");

Qt3DRender::QSceneLoader *sceneLoader = new Qt3DRender::QSceneLoader(m_sceneLoaderEntity);

sceneLoader->setSource(fileUrl); // fileUrl is input

m_sceneLoaderEntity->addComponent(sceneLoader);

我的应用程序的构建和运行对Qt 5.9.0、5.9.1、5.9.2、5.9.3和5.9.4都没有任何问题.到目前为止一切顺利.

My application builds and runs without any problem with Qt 5.9.0, 5.9.1, 5.9.2, 5.9.3 and 5.9.4. So far so good.

我的应用程序可以使用Qt 5.9.5、5.9.6和Qt 5.11.0很好地构建,但是在运行时,它无法导入STL文件,并且不给出任何错误消息!有人可以给我一个提示吗?

My application build fine with Qt 5.9.5, 5.9.6 and Qt 5.11.0, but when runs, it cannot import STL files and does NOT give any error message! Can anybody give me a hint?

我了解到Qt3D使用 assimp 来导入STL文件.我试图用Qt 5.9.4替换Qt 5.11.0 assimp动态库,即libassimpsceneimport.so,但是没有用:

I understand that Qt3D uses assimp to import STL files. I tried to replace Qt 5.11.0 assimp dynamic library, i.e. libassimpsceneimport.so, with that of Qt 5.9.4, but it didn't work:


m3g1dd@linux:~/Qt5.11.0/5.11.0/gcc_64/plugins/sceneparsers> ls -lhrtci
total 17M
1613482572 -rwxrwxr-x 1 m3g1dd m3g1dd 172K Jun 10 08:41 libgltfsceneimport.so
1613482571 -rwxrwxr-x 1 m3g1dd m3g1dd 226K Jun 10 08:41 libgltfsceneexport.so
1613596422 -rwxr-xr-x 1 m3g1dd m3g1dd 6.8M Oct  8 10:00 libassimpsceneimport.so.Qt5.9.4
1613482570 -rwxrwxr-x 1 m3g1dd m3g1dd 9.8M Oct  8 10:00 libassimpsceneimport.so

推荐答案

我下载并安装了Qt 5.11.2 ,并且我的STL导入代码可以正常工作,如下所示.但是导入的STL默认将其环境色,漫反射色和镜面反射色设置为白色,我认为这与 assimp库:

I downloaded and installed Qt 5.11.2 and my STL import code works fine as show below. But the imported STL has its Ambient, Diffuse and Specular colors set to white by default, which I thinks is related to an issue of assimp library mentioned on these:

https://bugreports.qt.io/browse/QTBUG-69385

https://github.com/assimp/assimp/issues/2059

这篇关于在Qt3D中导入对象不起作用,但是没有错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆