What shall I say… Its in svn now
With blender bundled and some python script magic I was able to teach the SDK to use blender as an importer, so now the Model Import Tool and the right-click “Convert to j3o” option also work for 3DS and Collada DAE files This also means you can now batch-convert multiple 3ds or dae files by copying them to the assets folder and selecting multiple files (@jagwire)
For those who are interested in how it works and how it can be extended, have a look at the commit. Blender is called with the --background and --python-script command line options to convert the files, the scripts are in the commit as well. The model is first imported in blender and then saved as a blend file, finally imported via @Kaelthas great importer. All this happens in the background without blender even popping up. The python script does not much more than call the importer command and then save the file.
I actually found a template in blender (blender text editor) showing basically everything I needed to know, might also be interesting for people who want to do other blender-related tools like a model “game-readiness-checker”, the things described on our blender wiki page as automated processes in the SDK and stuff like that
Using this we can support all kinds of files basically, we do have to add support for each format separately but its very easy to do so from now on if theres a blender importer Note that still doesn’t get rid of the issue of “not game-ready model”
Known issues:
- The model import tool might fail when textures are not referenced externally by blender (and thus not reported or recognized by the importer), the model will show successfully in the preview but not successfully be converted to j3o in the project. Copy the model and textures to the assets folder to avoid this issue and convert the model. Most probably the model will not successfully display the textures anyway (they are not in slots that jme supports, still they keep the model from loading when they are not there in blender).
Cheers,
Normen