0

Is there a way to diagnose why SceneLoader in QML (Qt 5.8) might appear not to work?

In my current project, there's one (3DS) model that SceneLoader will show (and this worked first try), but I replace it with any other models.

I run qgltf on the models, load in their resource file, etc.. basically set everything up the same, but never models won't show.

My sceneloader status is also set to ready, as opposed to error when it cannot find the file.

I've noticed that if I don't scale my objects, it will appear as if their not showing, but nothing I do to the newer models (either scaling them in Blender or in a QML Transform) has any impact.

I once saw an app for preparing models for Qt, but I think it was discontinued, in any case I'm not able to find it now.

Is there some vertex limit? Some other limit? I can't find anything in the docs about why it mightn't work.

Code:

Entity {
   property SceneLoader shipObjSmall: SceneLoader {
      id: shipObjSmall
      source: "qrc:/models/tugboat-small.qgltf"
      // code to print status on onStatusChanged
   }
   components: [shipObjSmall]
}
Matt
  • 1,928
  • 24
  • 44
  • Your declaration as a property is weird. The SceneLoader is both a property and an id, I would not be sure this works... you should be able to just delete the `property SceneLoader shipObjSmall: ` part. – at-2500 Mar 17 '17 at 13:00
  • It doesn't seem to make a difference, though I completely agree. My habit of doing this is a relic from when I started Qt and had (still have to some degree) some confusing between IDs and properties. I suspect there's an issue with the loading or probably the model it self.. Because even if I load a `.ply` file itself (instead of the `gltf` version), it shows, but then I can't transform it with an `OrbitCameraController`, *i.e.* it's behaviour is just different. – Matt Mar 17 '17 at 16:01
  • 1
    AFAIK, Qt3D uses [assimp](http://www.assimp.org/) to load the models, you could try loading it into the [assimp viewer](http://www.assimp.org/main_viewer.html) – at-2500 Mar 17 '17 at 19:31
  • oh nice, I'd landed on that page a few times where it lists which models are supported, but I somehow never noticed that there's a viewer. I'll try it out, thanks! – Matt Mar 18 '17 at 15:09

0 Answers0