2

I want to import a .fbx file into my Scene3D, via the QMesh type, all in QML. Per the documentation,

QMesh will also support the following format if the SDK is installed and the fbx geometry loader plugin is built and found

So the result I want is something like the following:

Entity {
... 
   Mesh{
   source: "qrc:/3dmodels/potato.fbx"
   }
}

After some searching, I found this post on the Qt forum, which directed me to download and include the Autodesk SDK into my project (via CMake).

I think that the only part I am lacking is to build the geometry loader for fbx, which I found in the source files (Qt/5.11.1/Src/qt3d/src/plugins/geometryloaders/fbx).

My question: How do I build the fbx geomerty loader from source, and include it into my project?

Anders
  • 403
  • 3
  • 17
  • Similarly to [this](https://stackoverflow.com/questions/53234263/how-to-setup-qt-creator-to-use-autodesk-fbx-sdk-as-a-library) question, for me loading `fbx` files works out of the box. Did you try to simply load it? – Florian Blume Nov 13 '18 at 11:03
  • Yes, I tried to load it (with the code posted). The same error as @karamazovbros got is outputted. – Anders Nov 13 '18 at 11:18

1 Answers1

3

I learned the QSceneLoader supports FBX loading and was able to load my FBX files with the setSource function, so I would use that class instead of using QMesh. Here's the link to the QSceneLoader documentation:

https://doc.qt.io/qt-5.11/qt3drender-qsceneloader.html

karamazovbros
  • 950
  • 1
  • 11
  • 40
  • Thank you. I seem to have run into a new problem where some of the internal properties does not load, but that is a problem for another thread. – Anders Nov 14 '18 at 07:34