KatsBits Community

[MD3] EXPORT script for Blender 2.5+/2.6+

motorsep · 73 · 102527

0 Members and 1 Guest are viewing this topic.

Offline dmc2143

  • Defunct
  • Newbie
    • Posts: 9
Do you know if MD3 exporter can export shape keys animation (flapping flag) ?
Yes it can!! At least in 2.6 for sure.


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
Sweet! Anything particular I need to do to set it up right?


Offline dmc2143

  • Defunct
  • Newbie
    • Posts: 9
Huh, where to start.
I will assume you know quite a bit already, you've been around blender longer than I.
You will need to set up your shape keys, properties>objectdata>shape keys
click + to add your basis (basically your starting point)
click + again to add key 1
go into edit mode change key one to what you want it to be.

Now animating your shape key
This is where I got hung up at first, open the dope sheet and change it to shape keys. Here is where all shape key animation starts, just select your frame and make your key adjustments (slider), blender will auto-majicaly insert a key frame wherever in the timeline you adjust shape keys. No baking necessary just export the finished object(s) like normal. Some good tuts out there. All I know came from a few you tube videos last night. Look into f curves and object drivers too.

Now here's is where the excitement begins. Baking physics based animations to key frames. I won't get into yet, cause I don't enough myself, but it does work, I've tried it.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Adding to what dmc2143 mentioned. You'll need to be mindful that, iirc, MD3 originally limited the number of effectors that could/would influence a particular vertex to just two or three. That means if you have a number of Shape Keys, say five or six (and this isn't unlikely/unusual due to the way they work), effecting individual vertices it may cause problems at run time (dropped, broken or ineffectual motion) - if you're doing a cyclical animation for example you might want to try and limit yourself to just three keys - the "Basis" (start point), "Key1" (midpoint) and "Key2" (end point/duplication of 'Basis'). This might be/is probably different for other engines using the format though.


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
@dmc2143: So are you saying I can simulate cloth for a flag and export it straight into MD3 ? (or rigid body sim)


Offline dmc2143

  • Defunct
  • Newbie
    • Posts: 9
I am saying it's worth a try now. You will need to bake the physics to the timeline. properties>physics
I've done one simple physics test, a multi subdivided plane cloth falling onto a sphere and draping itself around the sphere. It exported to md3 just fine.

ADDED: Yes, I have exported a md3 flag with wind physics applied to a cloth / soft body plane.

About shape keys, I just did a test with 6 different keys and got errors, so Kat has the right of it. It appears to be a limitation in the md3 format itself. Untill blender can bake shape key animation data (if ever) we may be stuck on that one. Trust that I will be looking into it, there may be more treats to 2.6 yet.


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
I am using this exporter with 2.59 and I get no error. However, I am getting shader error upon loading my MD3 to the game:

models/flag/flag_joint.md3: could not load texture "NULL"

Here is export log: http://pastebin.com/ffsGQ0Yk

The model is simple box, no bones, no anims.

P.S. I don't have MD3 viewer for Linux and JavaMD3 viewer doesn't work / nor it wants to compile. Thus I can't check the model any other way, but loading it into the game.

Thank you.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Two things to try, see what they do;
  • switching the "/" to "\"
  • remove the *.tga extension
In the same boat as you though, JavaView doesn't work on Windows 7 :o(


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
same result - not working. Getting same error on model load and because of that model is not being rendered in-game.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Hmm.. looking at that data you posted again, a couple of other things stick out to take a look at. Try exporting a much smaller number of frames (less than 100, 99 or below); I can't remember off the top of my head but I recall there being a frame limit by which MD3 went a bit wonky afterwards. If you're using the same engine as before (Dark Places?) again check to make sure there are no frame limits in place.

Also try exporting the mesh without the "_" in the name, "flagjoint" or "flag-joint" at a push; underscores ("_") are another caveat with MD3. Again check any limits with the engine your using though. I know these aren't obviously related to 'shader' errors, but as we know problems and messages don't always tally up.


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
no no.. That's not it.

I made a skin file where I assigned a shader to the mesh: mesh_name,shader_name and I can see the model in-game now. But UV's are wrong. I exported using scale in the exporter's GUI.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
How are the UV's screwed up? Are they inverted, flipped, totally scrunched up and all over the place? Each 'symptom' has potentially different fixes - might be as simply as flipping a texture upside-down or left-to-right, or more likely, modelling actual size and not using the script to scale on export (that never really been a good way to model and export content for games as you know).


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
On the left - MD3, on the right - IQM :

http://farm8.staticflickr.com/7154/6483822233_859c80be09_b.jpg

MD3 should look like IQM. It's the same scene in Blender, just exported into 2 different formats.


Offline dmc2143

  • Defunct
  • Newbie
    • Posts: 9
Do you have md3shader defined as a custom property for the object? Somehow the UV coordinates aren't getting exported. Unless you've named your shader "NULL" it is a sign that UV texture is being ignored by the script for some reason.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Are you creating (and assigning) full a Material to the mesh rather than skipping that and applying the texture directly to the unwrapped UVWs?