Best format for animated model import

Hello,

I searched through the forum but wasn’t able to answer the following question:

I want to load some animated models in a JME application I am building. Which format should I use? Is Ogre the best solution? Apart from OGRE, which is considered the most suitable format for that purpose?



Thanks

The question make sense indeed.

There is a blender .blend file for example. It may contain advanced animation that can’t be translated to jmonkey since engine doesn’t support procedural animation. Furthermore there are more blender features that have no corresponding engine features such as advanced materials and multi uv-coordinates (jmonkey’s lighting shader supports only two at max).

Support for different formats may differ too. It was possible to import only mesh from blend files not so far ago. I can import whole scene now. But I don’t know how far is ogre files or blender files supported. Documentation doesn’t cover it in detail.

We have following pipeline: models are prepared in blender at first (there is developer approved tutorial made by Jonathan Williamson ) and then tries to import it by different means. We have not testes new direct blender importing but ogre formats working well for sure.

Pro hint: Try the manual before the forum: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:intermediate:file_types

Of course I saw the manual before looking in the forum, and as you may also see, it doesn’t say anything about animation! E.g. for several formats I read at the forum that only the mesh is supported, and this thing is not mentioned in the link you sent. So the question remains… :wink:

Yes, the animation support of the model formats is mentioned in the wiki, especially its mentioned multiple times that ogre is the best format. The wiki is not a collection of answers you might have in your head but a start to end explanation on how to use the engine.

Indeed I read about Ogre in the wiki. But I didn’t read anything about other formats with regards to animation, i.e. APART from Ogre. Hence the question (in which I specifically asked about the most suitable format for animated models APART from Ogre). So the question still remains… :wink:

1 Like

Both importers work and let you animate your models. Ogre might be more stable 'cause it is part of jME3 from the beginning. I think it’s much more fun to test both and then decide on your own.

…just use ogre -.- Obj only supports animation as one mesh per frame and the blender importer isn’t production ready. As written in the manual. Its not like we’re joking or want to annoy you when we say “use ogre”. And before theres discussions about that we should support loads of different formats, we won’t. We will always concentrate on a few select formats to allows best conversion results. Ogre is the exchange file format we support and blender is the 3d editor we try to support best we can. Hence they should not be considered the same (a simple model loader) but rather two different ways to get model assets into your game.

2 Likes

I have the same question, as of 2022 what is best 3d format for animated model (and scene) to use in JMe? According to wiki Ogre file format soon to be discontinued. Which format have better support and should be proffered now?

1 Like

gITF converted to .j3o is the best.

4 Likes

Thanks!

And I still have some questions regarding on how to load/convert glTF file. I’ve found thread JME GLTF Support and didn’t quite understood how it should work. Am I able to load gltf directly without converting (by using assetManager.loadModel())? If so then what is difference when I first convert model into .j3o and then load it?

And how to convert .gltf to .j3o? I’ve found JmeConvert tool, also jme wiki says about converting models in jMonkeyEngine SDK (but I’m not using the SDK). What is the best/correct way to convert models?

1 Like

JMonkeyEngine applications can load glTF models directly if the apps include the “jme3-plugins” library. However, JMonkeyEngine’s native format is J3O. Compared to loading a J3O, loading a glTF is inefficient. So it usually makes sense to convert your models to J3O at build time so you can load J3O at runtime.

There are many ways to convert models, and the “best” way might be project-dependent. In my own projects, I write little Java apps to convert my models—maximum flexibility but more code to maintain. If you’re using the SDK for other purposes, then using it for conversions might make sense. If you want to automate conversions without writing much code, then JMEC makes sense.

1 Like

I have one more question. Is it supported to export and load a whole scene with light and camera on it? Or I need to add light and set up camera manually after loading a scene?

Either cases would work, but in case of loading things from a .j3o file, your j3o file should already have them, most of time loading the lights and camera from a j3o file can be used in save/load game, use JmeExporter/JmeImporter to deal with this.

EDIT : and you may only save states and retrieve and apply them, camera state and light state (as vectors for instance).

1 Like

Sorry, didn’t quite get what you mean about states. What actually I need to do is to save gltf scene with light and camera configured on it, convert it to .j3o and then open in jme. Is it feasible?

I frequently have to remove such things from my models so yes it’s possible.

Regardless, it’s the closest you will get so you might as well try it and see how far you get.

1 Like

I mean instead of creating too many scenes and loading too many cameras, why not creating a global camera and a global light object and then adjust them with the data saved from j3o accordingly, by doing this you will minimize the camera and light objects (on init and on destruction).

Data states can be in the form of :

  1. Vector3f indicating translation/scaling/directional vectors and Quaternions for rotations.
  2. Matrix4f indicating a full state.
  3. ColorRGBA
  4. User names and passwords.

I’m working on an Android Live Wallpapers app: Ornamental. It has a collection of many different live wallpapers and what I’m thinking about it to implement a 3D wallpapers into it. So in my case the best option is when every 3D wallpaper is a custom scene that have already defined lights and camera. The app download it from the server and just load a scene and render it as a wallpaper. So it’s not a game-case use of JME engine.

1 Like