NDS Exporter Release : 0.3 alpha

Jan 24th, 2010 in ToolBox | 9 Comments »
Meet the Heavy

Meet the Heavy … on Nintendo DS

Blender 2.5 is not really stable yet but the NDS Exporter is “finally” working with Blender 2.5. Note the quotes in finally because the script works with at most the revision 25923 of Blender but not the Alpha-0 release.

Go to GraphicAll to get an up-to-date version of Blender 2.5 otherwise you’ll have to wait for the next alpha release.

I’m not forgetting Blender 2.4x users because I’m planning to apply almost the same changes on the script.

In this latest version, Animations are “supported” and extra Python modules like NumPy and PIL are not required anymore.

Here are some explanations:

  • NumPy was used to cast floats into point-fixed floats and I manage to write this with only the struct module.
  • PIL was used to convert texture images from your mesh materials into PCX images. Now you have to use a format that is readable by Blender (Use PNG for your UV editing and mapping and remember The Gimp is your friend). I’ve send a patch that enable Blender to read PCX to the Blender Community, but this will likely not be commited. Vote for it : [#20427] allow IMBuf to load PCX

Changelog for v0.3 alpha:

  • Rewrote all the binary conversion parts with the struct module.
  • Enabled Animation export.
  • Enabled commandline batch exporting.
  • Removed ability to export textures to PCX format.

Quick Tutorial:
(More consitent infos on the GitHub Wiki)

  1. Download
    Check and download files linked at the bottom of this post.
  2. Install
    Install the file nds_3d_export.py inside the scripts directory of your Blender installation.
    It may be found with the python function bpy.utils.script_paths() (only in Blender 2.5) or check the Files section in your User Preferences in the Blender.
  3. Export
    To export your model from Blender, first you have go to the menu File -> Export -> NintendoDS CallList then select the directory where you want to save the exported model.
    Unlike the former version of the script, there is no graphical interface to control options, therefore the script will export in binary with Animations, UVs, Normals (if these 3 last elements are present with the model). Colors export doesn’t work.
    If you want to export with other settings, read the doc/INSTALL file to export with the script batch_export_nds.py.
  4. Compile your DevkitArm project
    You must now have a mesh_name.bin and mesh_name.h.
    Put these files in the data directory of your DevkitARM project and add the glCallList stuff corresponding to your binary file.
    Check the demo sources of my libgoengine (in App_Test.cpp and data.h files).

Special Thanks to:
Tom Tallian for his great low poly models of Team Fortress 2

Download(s) :

tagged in , , ,

9 Responses to “NDS Exporter Release : 0.3 alpha”

  1. Das Says:

    Hi.
    I’v been download the exporter for blender but it dosent works.
    When i try to export something(include a simple cube or the mesh in the post) in the console appears this message:
    “Attribute error: “Material” Object has no attribute texture “.
    Can you help me to solve them?

    ps: i use blender 2.5 svn 26714 on Windows7

  2. kiniou Says:

    Yes I certainly can help you ;) but first I will need more infos on how you ran your export.
    My first thought is your model has no material and the script try to find some but maybe I’m wrong and I can’t remember if I even test the script without textures.
    Can you send me an email with the .blend file you are trying to export and a quick step-by-step on how you export it (like ran blender -> went to file menu -> etc …).
    If you tried within the Blender graphic interface (i.e “normal” mode), the script will export your model with default options. You can change the script behaviour with the batch_export_nds.py script in commandline by passing the correct options. You can read the doc/INSTALL file for a quick explanation on how to run this script.
    Anyway, I’ll do some more tests about this material property issue.

    PS: I’m sending you my contact information by email.

  3. Duke Says:

    Hi.
    I’m korean student.
    I have a problem.
    “Attribute error: “Material” Object has no attribute texture “.
    How can I solve this error

    I use Blender 2.5 SVN_26695 on windows XP

    Please help me…T.T

  4. kiniou Says:

    @Duke : I’ve sent you an email to get more infos about your issue.

    For everyone : The script available in the downloads section of this post must work with latest Blender 2.5. The python API has changed since my first release of this exporter therefore the script may not run.
    If the script don’t run, you can report me a bug with a comment on this page or at http://github.com/kiniou/blender-nds-exporter/issues .
    In order to debug properly, i’ll need the revision number of the Blender 2.5 you are using and the complete python log error (you can find this log when you run blender from shell).

  5. Alex Says:

    When I try to export my model with a texture it doesn’t save the shown pcx file…?!

  6. kiniou Says:

    As stated in the post above, the script for blender 2.5 loses PCX support because of PIL not working with python3 and also blender doesn’t support PCX natively.
    As a workaround, you can convert your texture with gimp or use libpng in your NDS project in order to load PNG. I didn’t try the last but i recall some NDS projects using libpng.

  7. Alex Says:

    @kiniou
    Thanks for fast answering! Using Gimp is a good idea, thank you!

  8. Alex Says:

    Does your script also support blender’s particle system?
    I mean that I can export smoke,…

  9. Marcio Says:

    Hi!

    I tried to execute your batch script (using Brutal.blend) with Blender 2.60a – Linux version, and the error is:

    NameError: name ‘bpy’ is not defined

    I’ve tried old 2.5 versions, but I only could run at 2.49, because the “script’s” folder structure is very different.

    Can we expect new versions of this NDS exporter? And about animations?

    Thanks!
    Marcio

Leave a Reply

*