【问题标题】:Qt3D qSceneLoader error when try to load .gltf尝试加载 .gltf 时出现 Qt3D qSceneLoader 错误
【发布时间】:2019-11-11 12:51:57
【问题描述】:

我尝试使用 qSceneLoader 加载 gltf

auto sceneObject = new Qt3DRender::QSceneLoader();
sceneObject->setSource(QUrl::fromLocalFile("3D/test.gltf"));
auto sceneTransform = new Qt3DCore::QTransform();
sceneTransform->setTranslation(QVector3D(12.0f, 7.0f, 0.0f));
auto sceneEntity = new Qt3DCore::QEntity(this->rootEntity);
sceneEntity->addComponent(sceneObject);
sceneEntity->addComponent(sceneTransform);

但它给了

Qt3D.GLTFImport: no default scene
Qt3D.Renderer.SceneLoaders: class Qt3DCore::QEntity *__cdecl Qt3DRender::Render::LoadSceneJob::tryLoadScene(class Qt3DRender::Render::Scene *,enum Qt3DRender::QSceneLoader::Status &,const class QStringList &,const class std::function<void __cdecl(class Qt3DRender::QSceneImporter *)> &) Failed to import QUrl("file:3D/test.gltf") with errors ()

这不会使所有程序崩溃,但不会出现对象。 我该如何解决?

【问题讨论】:

    标签: qt qt3d gltf qtwidgets


    【解决方案1】:

    如果我理解正确 - 当前版本的 Qt3D 仅支持 gltf1.0 时搅拌机,我用于制作 3d 模型仅导出到 gltf2.0。在 windows 下使用其他格式还有另一个问题 - 这个平台上的 qt 5.12.5 没有 assimp 插件(安装程序中的错误:https://bugreports.qt.io/browse/QTBUG-75145),所以它需要安装更新版本才能使用这些东西。

    【讨论】:

      猜你喜欢
      • 2018-05-03
      • 1970-01-01
      • 2013-10-12
      • 2014-07-28
      • 2023-03-14
      • 2011-04-02
      • 2017-06-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多