3
$\begingroup$

I use Blender to create my 3D models for my Iphone app that uses OpenGL ES. The default output format MD2 i know it is very old but i need this for a fast processing algorithm! How do I get Blender to output a MD2 file that has the following elements:

All Verticies and Faces (faces as triangles, not quads) Texture coordinates (UV Mapped) Preprocessed Normals

$\endgroup$
2

4 Answers 4

1
$\begingroup$

My goal is also to make .MD2 models for my mobile app, so here is my way:

  1. The SceneJS page that MCunha has suggested is a good start.
  2. It says that we need to install the MD2 exporter plugin into Blender. Unfortunately that link for the necessary md2_export_263.py file is broken, but here is an actual one from jerrylroberts' GitHub repository.
  3. Download it.
  4. I've followed the SceneJS page's instructions on modifying the source code (I don't really know if it's needed or not).
  5. In Blender 2.78c go to File > User Preferences... > Add-ons > Install from File..., browse for the above mentioned (and modified) Python file, then activate it by clicking on its checkbox.
  6. Select the mesh you want to export. It's important for it to be unwrapped and have at least one associated UV-Texture material (according to MCunha's first UFO:IA source). Then go to File > Export > MD2 (.md2)

That's all. I've checked the exported model by G3DViewer in Ubuntu and it seems to be okay.

$\endgroup$
0
$\begingroup$

Triangulating the faces:

In edit mode, select all the faces (keyboard shortcut:A) and go to Mesh> Faces > Triangulate Faces(or use the shortcut:Ctrl+T). This action will use the least amount of triangles possible.

Alternitively, Mesh > Faces > Poke Faces, or Alt+P, is sometimes a more perffered outcome for later modelling as it adds a center vertex in each face which the command will fan-fill around. However, .MD2 likes as little polygons as possible.

Preprocessed Normals:

Under Shading / UVs > Normals you can Flip Dirrection (HotKey: W) and Recalculate. You can also use the modifier: Normal Edit to offset, mix, and switch between Radial and Directional Normals.

UV mapping:

In edit mode, change your selection to 'edge' with Ctrl+Tab >Edge and click on all the outter seams with Shift+Alt+RMB and press Ctrl+E > Mark Seam.

Open up a new view by clicking and dragging either the top right or bottom left grated triangle towards the center of the screen. On the new tab that opend, press the 3D cube button on the bottom left to change view to: UV/image Editor. If you opened up too many, just click on the the triangle of the "top" one and drag it over the one you want to close.

Now, with Ctrl+Tab> Faces, select all with A, press U > Unwrap.

Texture Coordinates:

On the bar with the view select in the new tab, press the Island UV selection and display mode and drag and seperate each face outside the "0:1 Space" or "gridded box". Now slect the Keep UV and Edit Mode Mesh Selection in Sync button to the left of the UV mode selections and determine which UV island relates to your 3D object. This is especially useful when you have many identical faces that need different textures. Move and organize all the shapes back into the "0:1 Space" to a place where you can distinctly tell what portion of the 3D model each UV shape belongs. You can use the S key to "size" the UV maps in order to fit all the shapes back into the "0:1 Space".

Select all faces within the '0:1 Space', A, and find the tab labed UVs on the bar with the view selection. Finanly, > Export UV Layout and open the .png in photoshop to add and edit the texture coordinates.

There are a couple modifiers called UV Wrap and UV Project that may be what your after, but I never used these.

Exporting as MD2:

Edit: https://developer.tizen.org/community/tip-tech/scenejs-creating-and-importing-3d-animations-md2-format This guide will show you how to patch and install the MD2 file export plugin for Blender.

I hope this was what you needed.

Please offer any corrections or comments down below. This was alot of information and mistakes can be made.

$\endgroup$
7
  • $\begingroup$ file > export as .3Ds > delete all > Import .3Ds > export .MD2 i don't see in the menu the last > Export .MD2 what version of blender you use? $\endgroup$
    – T-student
    Oct 28, 2016 at 7:27
  • $\begingroup$ fragmosoft.com $\endgroup$
    – T-student
    Oct 28, 2016 at 8:07
  • $\begingroup$ @T-student I found exactly what you need. developer.tizen.org/community/tip-tech/… $\endgroup$ Oct 28, 2016 at 8:23
  • $\begingroup$ Questions on fourms I found said it worked, but I couldn't get it to and it seems you couldn't either, but that website has all the information you need. $\endgroup$ Oct 28, 2016 at 8:24
  • $\begingroup$ Looks like exporting as .MD2 is really difficult, but possible. $\endgroup$ Oct 28, 2016 at 8:28
0
$\begingroup$

I think you have to install the addon Also read this

$\endgroup$
1
  • 2
    $\begingroup$ Blender 2.43, 2.45, 2.46 $\endgroup$
    – T-student
    Nov 2, 2016 at 8:45
0
$\begingroup$

To create md2 files from blender I use an intermediate program called Fragmotion. This is from http://fragmosoft.com/

The flow is the following: 1) Create model in blender 2) Export as FBX (6.1 only, 7+ will not work) 3) Open FBX in Fragmotion. 4) Adjust size using Transform (top menu item) -> Transform Options. 5) Export as md2.

This does not actually answer the OP. But, I have found this flow works well enough to get me the md2 models I needed.

Disclaimer: I have been working primarily with non-animated models in md2. The few animated models I worked with required a bit of fidgeting. This is either because of the work flow or more likely because I am new to Blender and my rigging and animation could have been tweaky.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.