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

How to load 3D objects in scene3D dynamically QML?



  • In my QML project, I have a Scene3D component in which I load my 3D model. This part is a single QML file and likewise I have different QML files for different screens and use StackView to navigate between them.

    But, whenever I navigate to the QML which hosts the Scene3D component the transition lags/gets stuck for few seconds half way through the transition and then loads.

    How to avoid this chock up? I thought Loader might be of help. But Loader doesn't work in Scene3D.

    Below is the extract of what I am trying to do currently:

    Scene3D
    {
         id: scene3d
         anchors.fill: parent
         anchors.margins: 10
         focus: true
         aspects: ["input", "logic"]
         enabled: false
         cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
    
    
        //This is an entity file which has the 3D model
        ThreeDObj
        {
    
        }
    
    }
    
    This works fine but there is that choke up issue. Is there any efficient way to avoid that?
    

Log in to reply