Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-102389

Issues with relative source urls in imported QML components

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.3.1
    • 6.3
    • Quick: 3D
    • None
    • 50b0f207e8 (qt/qtquick3d/6.3) 50b0f207e8 (qt/tqtc-qtquick3d/6.3) 50b0f207e8 (qt/tqtc-qtquick3d/6.3.1)

    Description

      When importing models using Balsam the resulting QML component does not always resolve the .mesh url in the correct context.

      When running the attached project I get the following error:

      QSSG.warning: Failed to load mesh: C:/example_test/Test3DImport/content/meshes/waterBottle.mesh

      The path to the .mesh file is wrong and resolved in relation to the wrong context (Screen01.ui.qml).

      WaterBottle.qml is broken while ToyCar.qml works as expected.

      The reason is that in WaterBottle.qml the source URL is defined in the root component, while in ToyCar.qml the source URL is defined in a child and the root node is a 'Node'.

      If manually add a Node around the Model in WaterBottle.qml the issue is fixed. Alternatively, I can use Qt.resolvedUrl().

      The project I used for testing is attached.

      This has to be fixed in the importer by either always adding a Node around all Models or by using Qt.resolvedUrl().

      //Node { - Adding an extra Node does fix the issue
      Model {
          id: waterBottle
          rotation: Qt.quaternion(0, 0, 1, 0)
      
      
          scale.z: 10
          scale.y: 10
          scale.x: 10
      
          source: "meshes/waterBottle.mesh" //Qt.resolvedUrl would fix this!
      

      The used models are gltf reference models from Kronos (https://github.com/KhronosGroup/glTF-Sample-Models).

      Attachments

        1. Test3DImport.zip
          13.11 MB
          Thomas Hartmann

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              thohartm Thomas Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes