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. Unsupported format encountered (obj) - QT3D Mesh

Unsupported format encountered (obj) - QT3D Mesh

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qt3d qmeshqmlqt5.103drender
3 Posts 2 Posters 1.3k 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.
  • K Offline
    K Offline
    Konstantin Schraubek
    wrote on 23 Jan 2020, 07:29 last edited by
    #1

    Hey Guys, im trying to load a custom mesh in qml with qt3d. Im using Qt5.10.

    Now im getting an absolute strange error. The application says "Unsupported format encountered (obj)"
    Project is with CMake and Visual Studio.

    Same obj file can be loaded with the same code in QtCreator Application.

    Cant find anything in the internet regarding this topic.

    Code below
    import Qt3D.Core 2.0
    import Qt3D.Input 2.0
    import Qt3D.Extras 2.9
    import Qt3D.Render 2.0

    Entity{
        id: root
       property var pos
    
       property string meshSourcePath: "path/to/obj.obj"
    
        property color color: Qt.rgba(0.1,0.6,0,1)
    
        property var scale: Qt.vector3d(1,1,1)
    
        property double rotationDegreesAz
        property double rotationDegreenEl
    
        Mesh{
            id: mesh
            source: root.meshSourcePath
        }
    
        Transform{
            id: trans
            translation: pos
            rotationY: root.rotationDegreesAz
            scale3D: root.scale
        }
    
        PhongMaterial{
            id:mat
            ambient: root.color
            shininess: 0.2
            diffuse: ambient
            specular: ambient
        }
    
        ObjectPicker{
            id: picker
            onClicked: {
                console.log("ObjectPicker: " + root.name)
            }
        }
        components: [mesh,trans,mat, picker]
    }
    
    1 Reply Last reply
    0
    • K Offline
      K Offline
      Konstantin Schraubek
      wrote on 24 Jan 2020, 12:10 last edited by
      #2

      solved it.
      had to copy "geometryloaders" from Qt5.10/plugins to the applicatoin directory.

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 24 Jan 2020, 19:56 last edited by
        #3

        Hi,

        Good catch ! I just remembered that there was an issue in earlier versions where the deployment tool didn't properly copy all the needed plugins. It has been fixed in between.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        3/3

        24 Jan 2020, 19:56

        • Login

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