Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt Quick3D: Unable to Load STL/STEP/GLB Models in QML (Works Only with .mesh from Balsam)
Qt 6.11 is out! See what's new in the release blog

Qt Quick3D: Unable to Load STL/STEP/GLB Models in QML (Works Only with .mesh from Balsam)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 45 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SabarishR
    wrote last edited by
    #1

    Description:

    I’m working on a Qt Quick3D application and facing issues loading 3D model files in QML.

    Project Setup

    • Qt version: 6.8
    • Modules used: Quick, Quick3D, QuickEffects, Network, WebSockets, Charts
    • CMake-based project

    I’ve included my CMake configuration below:

    cmake_minimum_required(VERSION 3.16)
    project(appsampleUI VERSION 0.1 LANGUAGES CXX)
    
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    find_package(Qt6 REQUIRED COMPONENTS Quick Quick3D QuickEffects Network WebSockets Charts)
    qt_standard_project_setup(REQUIRES 6.8)
    
    qt_add_executable(appsampleUI main.cpp)
    
    qt_add_qml_module(appsampleUI
        URI sampleUI
        VERSION 1.0
    
        QML_FILES
            Main.qml
           .........etc
    
        SOURCES
            SharedData.h
             .........etc
    
        RESOURCES
            .........etc
    )
    
    qt_add_resources(appsampleUI "assets"
        FILES
            meshes/bg.png
            meshes/logo.png
            meshes/link0.mesh
            meshes/link1.mesh
            meshes/link2.mesh
            meshes/link3.mesh
            meshes/link4.mesh
            meshes/link5.mesh
            meshes/m0.mesh
            meshes/m1.mesh
            meshes/m2.mesh
    )
    
    target_link_libraries(appsampleUI PRIVATE
        Qt6::Quick
        Qt6::Quick3D
        Qt6::QuickEffects
        Qt6::Network
        Qt6::WebSockets
        Qt6::Charts
    )
    

    Issue

    • When I use .mesh files generated using Qt Balsam, the models load correctly in QML.

    • However, when I try to load other formats like:

      • .stl
      • .step
      • .glb

    I get errors indicating that the files cannot be found or are not loaded.


    Questions

    1. Does Qt Quick3D support loading .stl, .step, or .glb files directly in QML?
    2. If not, what is the recommended workflow for using these formats?
    3. Is conversion to .mesh using Balsam mandatory for all 3D assets?
    4. Could this issue be related to how resources are added in CMake (e.g., qt_add_resources)?

    Additional Notes

    • Resource paths are referenced using the :/assets/ prefix.
    • .mesh files work fine from the same resource location.
    • Only non-mesh formats fail to load.

    Any guidance or best practices for handling 3D model formats in Qt Quick3D would be greatly appreciated.

    Thanks in advance!


    SabarishR

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved