Inside3D!
     

Blender MDL export
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Modeling
View previous topic :: View next topic  
Author Message
Preach



Joined: 25 Nov 2004
Posts: 122

PostPosted: Sat Feb 09, 2008 10:47 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
motorsep



Joined: 02 Aug 2006
Posts: 17
Location: Del Rio, TX

PostPosted: Sun Feb 10, 2008 7:43 pm    Post subject: Reply with quote

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 Sad
It would be much appreciated if you could look into it, Preach. Pleeeaaasseee Smile
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
motorsep



Joined: 02 Aug 2006
Posts: 17
Location: Del Rio, TX

PostPosted: Sun Feb 10, 2008 7:45 pm    Post subject: Reply with quote

Wow. That dude looks cool. Where can I download TF2 low-poly models (I assume they can be imported into Blender for dissection)?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Preach



Joined: 25 Nov 2004
Posts: 122

PostPosted: Sun Feb 10, 2008 7:59 pm    Post subject: Reply with quote

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/cs4455_spring/planetquake/modediting.html for a table of all of them.
Back to top
View user's profile Send private message
motorsep



Joined: 02 Aug 2006
Posts: 17
Location: Del Rio, TX

PostPosted: Tue Feb 12, 2008 7:00 pm    Post subject: Reply with quote

Preach, have you looked into blender2md5 and that broken smd exporter?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Tue Feb 12, 2008 9:07 pm    Post subject: Reply with quote

Blender2MD5 doesn't need fixing.
_________________
Back to top
View user's profile Send private message
FrikaC
Site Admin


Joined: 08 Oct 2004
Posts: 947

PostPosted: Tue Feb 12, 2008 9:33 pm    Post subject: Reply with quote

Preach, some code I have for a few home projects I've been working on is all broken. Have you looked into to fixing it for me?
Back to top
View user's profile Send private message Send e-mail
motorsep



Joined: 02 Aug 2006
Posts: 17
Location: Del Rio, TX

PostPosted: Tue Feb 12, 2008 11:21 pm    Post subject: Reply with quote

blender2md5 doesn't need to be fixed, but it still doesn't export to smd Smile
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Wed Feb 13, 2008 4:10 am    Post subject: Reply with quote

That's because it is intended to export to md5 and is not intended to support SMD, so it is a non-bug
_________________
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Wed Feb 13, 2008 4:41 am    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message
Preach



Joined: 25 Nov 2004
Posts: 122

PostPosted: Wed Feb 13, 2008 9:37 am    Post subject: Reply with quote

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 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.
Quote:
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

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.

Quote:
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)

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.

Quote:
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.

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.
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Wed Feb 13, 2008 9:44 am    Post subject: Reply with quote

Try this silly gun i just modeled for this
http://leileilol.mancubus.net/vs97/Autorifle.zip
_________________
Back to top
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Sun Mar 23, 2008 2:49 pm    Post subject: Reply with quote

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?
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Preach



Joined: 25 Nov 2004
Posts: 122

PostPosted: Sun Mar 23, 2008 2:58 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Mon Mar 24, 2008 3:01 am    Post subject: Reply with quote

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?


they're bullshitting you because they think bob's old beroken 2003 2.32 script is the most current one out there.

if that was true, then OpenArena wouldn't exist

Preach wrote:
Try this:


old and out of date, this is better
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Modeling All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group