Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Loading .FBX file with QT



  • I am trying to load a .FBX file using the QT3D library. Currently I am running on windows.

    However, I am getting a Found no suitable importer plugin for QUrl error on loading the file. I am guessing that the assimp inside the QT3D module is not linked or something. Is there a need to link it inside the .pro file or something? If so how do I do that?

    Thanks.

    // main.qml
    
    import QtQuick.Controls 1.4
    import QtQuick.Dialogs 1.3
    import QtQuick.Scene3D 2.0
    
    import Qt3D.Core 2.0
    import Qt3D.Render 2.0
    import Qt3D.Input 2.0
    import Qt3D.Extras 2.0
    
    ApplicationWindow
    {
        visible: true
        width: 640
        height: 480
        title: qsTr("3D Viewer")
    
        toolBar: ToolBar
            {
                ToolButton
                {
                    text: "Open 3D Model"
                    onClicked:
                    {
                        fileDialog.open()
                    }
                }
            }
    
        FileDialog
        {
            id: fileDialog
            onAccepted:
            {
                sceneLoader.source = fileDialog.fileUrl
            }
        }
    
        Scene3D
        {
            anchors.fill: parent
    
            aspects: ["input", "logic"]
            cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
    
            Entity
            {
                id: sceneRoot
    
                Camera
                {
                    id: camera
                    projectionType: CameraLens.PerspectiveProjection
                    fieldOfView: 30
                    aspectRatio: 16/9
                    nearPlane : 0.1
                    farPlane : 1000.0
                    position: Qt.vector3d( 10.0, 0.0, 0.0 )
                    upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
                    viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
                }
    
                OrbitCameraController
                {
                    camera: camera
                }
    
                components: [
                    RenderSettings
                    {
                        activeFrameGraph: ForwardRenderer
                        {
                            clearColor: Qt.rgba(0, 0.5, 1, 1)
                            camera: camera
                        }
                    },
                    InputSettings
                    {
                    }
                ]
    
                Entity
                {
                    id: monkeyEntity
                    components: [
                        SceneLoader
                        {
                            id: sceneLoader
                        }
                    ]
                }
            }
        }
    }
    
    
    
    

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What format is that and where does it come from ?
    What version of Qt are you using ?



  • @SGaist
    FBX is an Autodesk format. Assimp theoretically supports it: https://github.com/assimp/assimp/blob/master/code/FBXDocument.h I don't know if Qt3D's use of Assimp disables it or needs some extra glue code?

    @charlie514841 How was the FBX file made? With what version of what software, etc? Can you download the AssimpView utility from upstream assimp, and see if it loads the file and displays it correctly? If assimpview can't read the file, then it's probably not a Qt issue, just a problem with the assimp library that Qt uses and you may need to talk to the developers of that library.



  • @wrosecrans said in Loading .FBX file with QT:

    AssimpView

    I am using Qt 5.11.2. Yes the AssimpView utility works fine and can open the file.

    Just curious, is there an additional compilation step to install assimp or linking step inside the .pro file to be done seperately for it to work? Because I have always assumed that there is a assimp dll included within the Qt framework directly.

    More specifically, the error was

    Qt3D.Renderer.SceneLoaders: Qt3DCore::QEntity* Qt3DRender::Render::LoadSceneJob::tryLoadScene(Qt3DRender::Render::Scene*, Qt3DRender::QSceneLoader::Status&, const QStringList&, const std::function<void(Qt3DRender::QSceneImporter*)>&) Found no suitable importer plugin for QUrl
    

  • Lifetime Qt Champion

    Do you get the same error if you use the path to you file directly in your QML code ?



  • @SGaist Yes I get that as well.


  • Lifetime Qt Champion

    Would it be possible to share that file or at least a minimal example to test ?



  • @SGaist Hello SGaist, I have same problem, then I give you an example with 2 model, one in obj, qt is able to load it and the fbx qt unable to load it..

    I install the FBXSDK and in pro file I try to import libs with:

    LIBS += -LE:/Qt/5.11.2/msvc2015_64/lib/SDKFBX/x64/release/ -llibfbxsdk
    INCLUDEPATH += E:/Qt/5.11.2/msvc2015_64/include/SDKFBX/fbxsdk
    DEPENDPATH += E:/Qt/5.11.2/msvc2015_64/include/SDKFBX/fbxsdk

    but same message:
    Qt3D.Renderer.Jobs: unsupported format encountered (fbx)

    here the dropbox link with project
    https://www.dropbox.com/s/0k637m2cpzfao3m/simple-qml.zip?dl=0

    kind regards
    Philippe



  • Did you ever figure this out?


Log in to reply