I recently watched this excellent 4-part video series on rigging and animating 3D models and then importing them into jME3. In the third video the author opens up the jME SDK/IDE (NetBeans) and converts his Kang.blender file into a Kang.j3o file using a right-click menu.
I’m wondering if its possible to do the exact same conversion outside of the SDK/IDE? Perhaps there is a command-line tool I could use?
No, sorry. But its only one class, so it should be quite easy to reuse… To load the .blender and write a .j3o is actually only 4 lines of code - the rest is about also exporting the textures, material definitions, generating tangents and preserving some directory structure that i need in my project…
Edit: I start it with gradle run -PappArgs="-asset_dir,…/Locomotion/assets,-import_dir,…/Assets/,-create_tangents"
this “appArgs” is just some “hack” to get commandline arguments through gradle to my app. If you build it and run the binary from commandline you can pass the arguments “normal”. asset_dir is the target directory for the .j3o and stuff and the import_dir is where the .blender is.
@normen - are you suggesting I build my own Savable? I can’t quite infer what you mean by just posting the link… So something like a BlenderSavable that loads a .blender file and saves it in .j3o format?
No he just posted you the link to the wiki where is the example of how to “save a node”. So you just load the .blender file using the assetmanager and then run the code from “save a node” and you have a .j3o…
Yes thats basically it. And I didn’t say that the materials are not converted correctly. But this way you will not get external material files (material properties are also stored in your resulting .J3O) and there is nothing done with the textures - so the path are the same as in blender, so if the have been stored relative to the .blender files in blender they need to be also in the same relative directory where you later load the .J3O…