3DS, Collada import through blender in SDK

Home Forum Troubleshooting jMonkeyEngine SDK 3DS, Collada import through blender in SDK

This topic contains 12 replies, has 7 voices, and was last updated by  Paul Geraskin 1 year, 8 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #202668
    +10

    Normen Hansen
    2778p
    Keymaster

    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 :D 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

    #202672
    +1

    pspeed
    3024p
    Keymaster

    This. :)

    #202677
    +1

    nehon
    1849p
    Keymaster

    :-o this is huge Normen.

    #202686
    +1

    Wesley Shillingford
    833p
    Participant

    Awesome :)! Good job as usual

    #202687
    +1

    Paul Geraskin
    359p
    Participant

    Super Puper!

    #202695
    +1

    haze
    64p
    Participant

    Great !

    #202735
    +1

    jagwire
    5p
    Participant

    This is great stuff! Well played.

    #203036
    +3

    Normen Hansen
    2778p
    Keymaster

    I now made it possible to also set blender import key options when importing a model format supported through blender:

    #203053
    +1

    Paul Geraskin
    359p
    Participant

    @normen , don’t you think to add LWO support? Lightwave users will be happy. :)
    But you will need to switch the addon on. It’s off by default.

    In python to switch the addon on you will need to do this:

    You will need to do this every time when blender runs.

    #203075

    Normen Hansen
    2778p
    Keymaster

    When blender is downloaded from the web and put in the installer, I can’t go to that menu in between.. I guess somebody has to prepare presets and blender configuration hints so we know how to manipulate the settings files etc ;)

    #203079
    +1

    Paul Geraskin
    359p
    Participant

    @normen said:
    When blender is downloaded from the web and put in the installer, I can’t go to that menu in between.. I guess somebody has to prepare presets and blender configuration hints so we know how to manipulate the settings files etc ;)

    You can enable the script in your python:


    Voila, and you can run the lwo importer as obj importer… :)

    #203088

    Normen Hansen
    2778p
    Keymaster

    Btw, I see other interesting importers there like MakeHuman etc.. I guess some of these need some post-processing but some would definitely be interesting for jME. We can extend the BlendKey to have extended options for scripts as well btw :)

    #203090
    +1

    Paul Geraskin
    359p
    Participant

    Ok, I talkedt to Normen and he said that JME already has LWo importer. But anyway i did the LWO importer through the blender.
    If you want to use it somewhen you are welcome.

    Taken from here: http://code.google.com/p/jmonkeyengine/source/browse/#svn%2Ftrunk%2Fsdk%2Fjme3-blender%2Fsrc%2Fcom%2Fjme3%2Fgde%2Fblender%2Fscripts

    import_lwo.py:

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.