How to convert fbx file to J3o file

How to convert fbx file to J3o file

24 days ago there was some topic:

it might help.

Some tips from someone who fought this for much too long. The FBX support is limited based on what you are trying to import in your FBX. I personally needed mesh morphs, and was not having any luck, from my understanding, there are other FBX features that are also not yet implemented.
I did the approach of importing my FBX into blender, and exporting as glTF. The glTF as great support in jme. But there is a catch, glTF does not have great support in blender, unless you are running the beta, which has a strange issue importing FBX files.

So to do it:

  • First, using the non-beta blender, import the FBX into a blender project and make any changes you want.

  • Second, go grab the beta copy of blender.

  • Third, open your blender project, if you do not see any materials on the model, this is fine it is blender beta not rendering them correctly.

  • Fourth, export to glTF 2.

  • Fifth: Do not use the JME SDK to perform the conversion of the glTF file to J3O, instead use this snippet of code:

      public void convertModel(String model, String name) {
          Spatial model1 = assetManager.loadModel(model);
          //Load new mesh
          File conversion = new File("conversions" + File.separator + name + ".j3o");
          BinaryExporter be = new BinaryExporter();
          try {
    , conversion);
          } catch (IOException e) {

Then in your main run
convertModel("Models/myModel.gltf", "myModel")
(or what ever your model name is and where it is in your assets)
The model will be in a conversions folder in your project. Just copy it where ever you want.

EDIT: To clarify something I forgot. That snippet needs to be run on the master branch of jme.


Just curious was there a bug with importing gltf? besides being unable to show the material when using a maven project?
Because the SDK should perform the exact same code.

1 Like

I was getting several errors in the console. I forgot to mention that I am using the master branch, which has a commit that fixes up some of the issues with glTF 2.

EDIT: @Darkchaos Perhaps it was because of this issue: (Which should be fixed in 3.2.x) J3MLoader warnings while loading glTF sample models · Issue #741 · jMonkeyEngine/jmonkeyengine · GitHub
I am having trouble remembering now…

1 Like