Blender MDL export
Arrrghghgh in some ways blender is a little annoying. For instance, they have a built-in function for creating gui buttons/gui menus. One of the parameters it takes is the "default" value, which all sounds great and sensible. The problem is that in order to redraw the gui, the function to create the button is run again, which resets it to it's default value! The only workaround I can find is to pass the known value of the button as the default value parameter of the create button, so that every time it's redrawn it's recreated with the default value it's already known to have(I later found this is what the working buttons in the gui were already doing). Of course, none of this is documented in the blender manual, presumably because writing that up would cause the developers to die of embarrassment.
So, new version of the script is up at
http://people.pwf.cam.ac.uk/~ajd70/mdl_export.py
Features this time are added are:
*Scale button now works.
*Added a flags parameter. At the moment this is just a number entry field, if people really need I could change it to a series of toggle buttons for each flag. There's no way to make check boxes in the standard package.
*Added UV fixing options. Translate UV's means that UV's outside the range are moved up/down by skinwidth or skinheight until they are in the range [0,skin(height or width) - 1]. This is useful if you find the uvs are aligned up with the skin, but in the range [-1,0].
Clamp UV's just moves any points which are out of range to the nearest edge of the skin, so if it's at -5 it gets moved to 0, if it's at skinwidth it gets moved to skinwidth - 1.
As a promo, I spent 30 mins converting one of those sweet TF2 low poly models to mdl format. The time consuming things were duplicating the polys that should be double-sided and making a conversion of the skin to the quake palette, once you use the blender "Consolidate onto one image" function the actual conversion is painless.
The Sniper
So, new version of the script is up at
http://people.pwf.cam.ac.uk/~ajd70/mdl_export.py
Features this time are added are:
*Scale button now works.
*Added a flags parameter. At the moment this is just a number entry field, if people really need I could change it to a series of toggle buttons for each flag. There's no way to make check boxes in the standard package.
*Added UV fixing options. Translate UV's means that UV's outside the range are moved up/down by skinwidth or skinheight until they are in the range [0,skin(height or width) - 1]. This is useful if you find the uvs are aligned up with the skin, but in the range [-1,0].
Clamp UV's just moves any points which are out of range to the nearest edge of the skin, so if it's at -5 it gets moved to 0, if it's at skinwidth it gets moved to skinwidth - 1.
As a promo, I spent 30 mins converting one of those sweet TF2 low poly models to mdl format. The time consuming things were duplicating the polys that should be double-sided and making a conversion of the skin to the quake palette, once you use the blender "Consolidate onto one image" function the actual conversion is painless.
The Sniper
What flags are "available" for mdl / md3 models? And what do they stand for?
Regarding that SMD exporter. Besides the fact that it's very broken, it also doesn't work properly with advanced rigs. It works fine probably with simple Forward Kinematic rig, but when you have various constraints and IK for your rig (and multiple meshes per rig), it screw things up
It would be much appreciated if you could look into it, Preach. Pleeeaaasseee
Regarding that SMD exporter. Besides the fact that it's very broken, it also doesn't work properly with advanced rigs. It works fine probably with simple Forward Kinematic rig, but when you have various constraints and IK for your rig (and multiple meshes per rig), it screw things up
It would be much appreciated if you could look into it, Preach. Pleeeaaasseee
The TF2 models are being dicussed in http://forums.inside3d.com/viewtopic.php?t=901. There's a obj importer for blender that handles them just fine(aside from two sided polygons.
The flags are for setting trails and rotation on models, see the bottom of http://www.cc.gatech.edu/classes/AY2000 ... iting.html for a table of all of them.
The flags are for setting trails and rotation on models, see the bottom of http://www.cc.gatech.edu/classes/AY2000 ... iting.html for a table of all of them.
wah, it has that stupid 'object should not be rotated - fixing for you' behavior from the md2 exporter. This is stupid behavior and should not be done as rotating objects can be necessary.
I also get a TypeError: expected object or string and optional integer arguments coming from line 903. Blender 2.43
The "BEEP!" is annoying, blender 2.45
and my model points up and doesn't really export like it should (with Blender pointing the object in the correct intended direction) this is some of the reasons why the MD2 exporter sucks alot and MD3 exporter doesn't. The triangle conversion is stupid too (md3 exporter does that itself in the buffer)
also even though my skin is actually an 8bit PNG, it appears mostly black on the MDL
and my animations can't seem to export. At all.
I also get a TypeError: expected object or string and optional integer arguments coming from line 903. Blender 2.43
The "BEEP!" is annoying, blender 2.45
and my model points up and doesn't really export like it should (with Blender pointing the object in the correct intended direction) this is some of the reasons why the MD2 exporter sucks alot and MD3 exporter doesn't. The triangle conversion is stupid too (md3 exporter does that itself in the buffer)
also even though my skin is actually an 8bit PNG, it appears mostly black on the MDL
and my animations can't seem to export. At all.
i should not be here
I will look into applying all kinds of transformations eventually, but for now it's designed for models that animate the vertices. Since I don't actually have any suitable test files, I'm relying on md2s I've imported, which are set up like this. If you could put your files up for download I'd have test cases to work from.leileilol wrote:wah, it has that stupid 'object should not be rotated - fixing for you' behavior from the md2 exporter. This is stupid behavior and should not be done as rotating objects can be necessary.
I did say it worked in 2.4.4, it's very hard to make a script that works in all versions because the developers keep pulling the rug from under your feet.I also get a TypeError: expected object or string and optional integer arguments coming from line 903. Blender 2.43
The "BEEP!" is annoying, blender 2.45
Once other transformations are supported it'll face the right way. The triangle conversion I had noticed before, that shouldn't be too hard to fix.and my model points up and doesn't really export like it should (with Blender pointing the object in the correct intended direction) this is some of the reasons why the MD2 exporter sucks alot and MD3 exporter doesn't. The triangle conversion is stupid too (md3 exporter does that itself in the buffer)
The script doesn't do any conversion to the quake 1 palette, if a pixel is not one of the q1 palette colours then it is mapped to black. Do the conversion first, it's bound to look better than what the script could be made to do, avoiding fullbrights etc. As mentioned above, animation for the current version needs to be done at the vertex level, otherwise I can't vouch for what happens. Send me your models where the animation is failing and I can work on that for a new version.also even though my skin is actually an 8bit PNG, it appears mostly black on the MDL
and my animations can't seem to export. At all.
Try this silly gun i just modeled for this
http://leileilol.mancubus.net/vs97/Autorifle.zip
http://leileilol.mancubus.net/vs97/Autorifle.zip
i should not be here
Try this:
http://cube.wikispaces.com/Blender+Animated+Md3+Export
Let me know if this also works with bones, I'm looking to see what it does different. One thing it does is applies the global transformation matrix to each vertex, so I'll do that next time. But the only other thing it seems to do differently is use the depreciated "NMesh" rather than the current "Mesh" API. Hopefully that isn't the key to making animation transforms work...
http://cube.wikispaces.com/Blender+Animated+Md3+Export
Let me know if this also works with bones, I'm looking to see what it does different. One thing it does is applies the global transformation matrix to each vertex, so I'll do that next time. But the only other thing it seems to do differently is use the depreciated "NMesh" rather than the current "Mesh" API. Hopefully that isn't the key to making animation transforms work...
they're bullshitting you because they think bob's old beroken 2003 2.32 script is the most current one out there.Urre wrote:This is somewhat offtopic, but the modeler from my team says Blenders md3 exporter is incomplete, that it only exports single frame models. Is this true, or does there exist a md3 exporter for blender with support for animations and tags?
if that was true, then OpenArena wouldn't exist
old and out of date, this is betterPreach wrote:Try this:
i should not be here