blender mdl7 exporter

Posted By: ventilator

blender mdl7 exporter - 01/03/05 14:43

i played around with python scripting in blender and created a mdl7 exporter.

3dgs_mdl7_export.py ~ 10kb



usage:
  • copy the script to your .blender/scripts folder
  • start blender (the latest version is 2.36)
  • select a polygon object
  • file -> export -> 3dgamestudio mdl7 (.mdl)...
  • the model/world space option doesn't have an effect yet (just wanted to have some more buttons )
  • animation sequences get defined by a list of frames separated by spaces (see screenshot). you can scroll up and down by dragging the gui with the middle mouse button if the animation list gets longer. all animations get exported as vertex animation for now.
  • press export and enter a filename
  • wait until "done!" appears in the console


known issues:
  • the current method of generating the uv list can be quite slow with big models (with several thousand polygons)
  • animation does only get exported correctly if the model is visible in a 3d view during the export


maybe some blender users (i don't think there are many on this forum) find it useful.
Posted By: Orange Brat

Re: blender mdl7 exporter - 01/03/05 16:16

It'll probably come in handy one day. I've been studying Blender and it's not bad once you get used to the UI. The quickstarts at Blender3d.org are a good start. It's actually a very powerful app and you can't beat the price.
Posted By: WHURL

Re: blender mdl7 exporter - 01/03/05 22:17

Quote:

maybe some blender users (i don't think there are many on this forum) find it useful.




I'll find it very useful indeed, ventilator. Thank you!
Posted By: Yu_Une

Re: blender mdl7 exporter - 01/04/05 14:16

Cool , you completed what I gave up on.
Posted By: Error014

Re: blender mdl7 exporter - 01/05/05 05:56

Thanks! This seems to be very useful

And now let me pass the words of a very good modeller. Way better than me. I still have problems understanding the UI of Blender, but anyway, here are his words:

In Antwort auf:


blender rockt! =)..THX A LOT. gone crazy on finding a way to do the job of this script.
give blender a try- at least 1 or 2 weeks




Posted By: jono

Re: blender mdl7 exporter - 01/05/05 21:57

excellent. can't wait to try it out.
Posted By: Alkai

Re: blender mdl7 exporter - 01/05/05 23:15

Great job Vent! I'll mess around with it some.

Somebody at Blender REALLY needs to get the documentation done.
Posted By: jono

Re: blender mdl7 exporter - 01/05/05 23:31

when they ever finish the online docs, they won't sell the paperwork ;-)
Posted By: Ambassador

Re: blender mdl7 exporter - 01/06/05 01:37

Good work! This will be in heavy use at my place

Thanks!
Posted By: jono

Re: blender mdl7 exporter - 01/06/05 04:31

hmm, little problem here exporting a textured 2k poly mesh I get this error:

vertex list generated...
uv list generated...
Traceback (most recent call last):
File "<string>", line 105, in gui
File "<string>", line 197, in export
File "<string>", line 180, in get_triangles
IndexError: list index out of range

However a simple polygon worked, so seems some object parameter is not healthy.
Well, I will find out ;-)
Posted By: ventilator

Re: blender mdl7 exporter - 01/06/05 04:40

thanks for testing it!

this doesn't happen with my test models (but i don't have many). if you find the error please post what was wrong. or you could send me your model so that i can have a look at it.
Posted By: jono

Re: blender mdl7 exporter - 01/06/05 04:56

sent you a PM , master Vent
Posted By: ventilator

Re: blender mdl7 exporter - 01/06/05 05:01

got it. your model contains degenerated faces. i should have included a check for that.

-> download the script again. your model exports fine now.
Posted By: Yu_Une

Re: blender mdl7 exporter - 01/06/05 07:21

I ran across this web page
Posted By: jono

Re: blender mdl7 exporter - 01/06/05 20:02

yes, works very well.
It makes things for your difficult, the modelling user errors

EDIT:
Cool, I can make use of LSCM unwrapping

Now you can model your mdls right away out of blenders box.


thanks a lot,
jono
Posted By: ventilator

Re: blender mdl7 exporter - 01/06/05 20:06

the exporter exports uv-maps. the uv-map of the model you sent me displays fine in med.

@husnok: yes, it would be nice if the exporter were included in the blender distribution but i don't know what rules/standards they have for their scripts. i think the exporter should mature some more before looking into that.
Posted By: jono

Re: blender mdl7 exporter - 01/06/05 20:12

yes, right, I was wrong, edited my incompetent post

THX
Posted By: Ambassador

Re: blender mdl7 exporter - 01/07/05 19:22

I have a one model that I some how modeled in a way that one polygon doesn't want to transfor to a valid triangle :| So I get the "list index out of range" error. This is not a big problem but I just wanted to mention that. I don't have a clue how I got the polygon there but all of my other models export VERY well. And ventilator, your script is the FASTEST export script that I have ever used with blender. Good work!

Btw you could e-mail to blender staff to get your script in to the next blender box. It would be realy usefull to me and as well many others.
Posted By: ventilator

Re: blender mdl7 exporter - 01/07/05 20:04

did you download the updated script? if the error still happens with it you could send me the model so that i can investigate it.

the exporter only is slow with high polygon models if they have an uv-map. i have to think of a less brute force way to get the uv-list. exporting isn't exactly time critical though.



from what i understand they only want to include scripts which are popular in the blender community. it's to early to look into that anyway.

- the script still is a bit messy

- i would like to support the updated model format (multiple textures per model, submeshes,...) once conitec is done with that

- the script should also support to export animations as bone animation but there are two problems with that:
i don't know much about blender's animation system and i don't want to learn it now because they plan to overhaul it for 2.37.
converting bone animation between applications can be tricky. my tries with exporters for other applications were quite discouraging so far. i will have to learn more about euler angle rotation orders, quaternions and so on.
Posted By: Ambassador

Re: blender mdl7 exporter - 01/07/05 23:26

www.geocities.com/flashers3/fox_4.zip

Here is my model
Posted By: ventilator

Re: blender mdl7 exporter - 01/07/05 23:39

thanks! your model exports fine. are you sure you downloaded the script again after i fixed the bug i found with the help of jono's model?
Posted By: Ambassador

Re: blender mdl7 exporter - 01/07/05 23:48

Yes I am totaly sure. But I'll download it again...
Posted By: Ambassador

Re: blender mdl7 exporter - 01/07/05 23:55

Well that is odd... Now it exports perfectly. Maybe my "intelligent" Mozilla remembered the file that I had downloaded ( when I last time downloaded the script ) and downloaded the same file... But now I have the new and everything works correctly.
Posted By: JeremyB

Re: blender mdl7 exporter - 01/08/05 09:00

This is really excellent! We have been exporting to .X from Blender and then importing back into MED. This will save an extra step.
Posted By: Ambassador

Re: blender mdl7 exporter - 01/09/05 04:18

Yes indeed... My blender X export doesn't even work correctly...
Posted By: Bright

Re: blender mdl7 exporter - 01/09/05 13:29

Dude, this code is the best exporting code ive ever seen. Now I dont have to use that old crummy MD2 exporter that works %50 of the time
Thanks again.
Posted By: Joey

Re: blender mdl7 exporter - 03/16/05 02:51

could you please upload the script again because it seems to be not available.

thanks for your great work!
joey.
Posted By: Ambassador

Re: blender mdl7 exporter - 03/16/05 03:53

Here is a link:

www.geocities.com/flashers3/3dgs_mdl7_export.zip

I took the freedom to upload it. I'll delete it if ventilator wants so...
Posted By: Joey

Re: blender mdl7 exporter - 03/16/05 04:45

dankeschön
Posted By: moobins

Re: blender mdl7 exporter - 04/12/05 14:57

yes, your exporter is very good,

but what can i do if i want to export model with many textures?

if i had one texture, it was easy to add texture in MED, but
what can i do if i have 15 textures?

can it be done in python?
please help
Posted By: ventilator

Re: blender mdl7 exporter - 04/12/05 15:09

currently the mdl7 format does only support one texture which covers the whole model. (it can store multiple textures but that's only meant for swapping a texture or for usage in shaders at the moment.)

with the 6.4 update models will support multiple textures on different model parts and then i will update the python script to automatically export all textures.
Posted By: moobins

Re: blender mdl7 exporter - 04/12/05 19:00

it will be cool.
Posted By: WHURL

Re: blender mdl7 exporter - 04/13/05 08:22

Quote:

...6.4 update models will support multiple textures on different model parts and then i will update the python script to automatically export all textures.




It's great to hear you are going to update the export plugin for multiple textures inline with 6.4 when it arrives, ventilator.

This plugin has been very useful to me. Thank you for producing it and keeping it up to date.
Posted By: FeiHongJr

Re: blender mdl7 exporter - 04/26/05 09:37

Thanks alot ventilator. I just recently starting using blender and this already has been a huge help. Thank you.
Posted By: ventilator

Re: blender mdl7 exporter - 05/11/05 07:55

is anyone here a 3dgs beta tester? i upgraded the plugin to support sub-meshes and multiple textures (external and internal) and wouldn't mind some testers.
Posted By: Ambassador

Re: blender mdl7 exporter - 05/13/05 09:25

Hmm... maybe you should contact Dan Silverman... if he uses blender... btw i noticed some time ago that your exporter doesn't understand bone scaling. But I don't need to scale bones anyway so no big deal. Your script has been a BIG help for me! Million thanks and pleace keep developing it!
Posted By: mmelo

Re: blender mdl7 exporter - 07/28/05 14:01

I am a total noob in 3dgs, I am currently playing with the demo and considering a purchase.

I modelled a simple thing in blender, assigned it some UV's (in face mode, cubic) and exported. I loaded it into WED using Add Model. The thing does show up, but completely black and doesn't cast shadows.

What am I doing wrong?

Thanks,


Miguel

PS - The export scale also seems strange: if I leave it as 1.00 it's too small. If I set it to 4.00 it seems to be the same size as 1.00. If I set it to 10.00 it does seem to finally scale. But, again, I may be doing something strange...
Posted By: ventilator

Re: blender mdl7 exporter - 07/28/05 14:11

you have to reapply the texture file in med. then it won't be black anymore.

the scale should work but usually you have to use much higher values like 64. in blender the units usually are more used like meters and in 3dgs more like inches.

...
i already have a new exporter which directly exports textures and supports the new model features but since the resulting models only will work with 6.4 i haven't released it yet.
Posted By: mmelo

Re: blender mdl7 exporter - 07/29/05 14:59

Hmmm... thanks for the suggestion. Unfortunately that didn't quite work. I selected the model, went to the textures tab and d-clicked one of the textures (I believe this is the way to do it, right?). It still comes out black. And, as I said, it casts no shadows, unlike the WED primitives.

One thing I noticed is that the object appears, in the 3d preview window, as wireframe - unlike the rest of the stuff that appears as textured (I set it as such). Is this normal for models that are not primitives, or does this hint at the problem I am having?

Once again, many thanks.
Posted By: Ambassador

Re: blender mdl7 exporter - 07/29/05 19:15

If you wan't a model cast shadows in 3DGS you have to set the "shadow" flag on ( right click the model > properties ) And note that shadows for models work only in pro and comm version if I'm correct.

All models show up as wireframes in WED.

And about the model texture... hmm... If I'm correct you should just go to the skin editor in med and open a new skin. Does the skin show up in med? ( If you wan't to see a textured model in med you have to set the 3D view to show textures )

If this doesn't help you could take a quick look at the manual...
Posted By: eleroux

Re: blender mdl7 exporter - 08/12/05 04:49

I'm sorry I arrived late to this party, but... Is there a way to get the .py file again? The link doesn't seem to work anymore...


Emilio
Posted By: WHURL

Re: blender mdl7 exporter - 08/12/05 04:58

It's on the wiki. In the resources section / Free Tools.
Posted By: Orange Brat

Re: blender mdl7 exporter - 08/12/05 05:02

It's also still on the first page of this thread, but a few posts down.
Posted By: ventilator

Re: blender mdl7 exporter - 08/26/05 19:45

i finally seem to understand mdl7 bone matrices! expect to see an exporter which supports bone animations once blender 2.4 with the overhauled animation system is out.

all my tries to export bone animations from other applications weren't successful so far so i thought this time i do it the other way around. i wrote an opengl model viewer to examine how it works. after a lot of trial and error chucha7.mdl walks like it should and some things got clearer.
Posted By: WHURL

Re: blender mdl7 exporter - 08/27/05 07:03

Thanks for the continued effort, ventilator.

Keep us posted!
Posted By: Loopix

Re: blender mdl7 exporter - 08/27/05 20:25

Thanks! Think I should finaly get to know blender...
Posted By: Sinthoras

Re: blender mdl7 exporter - 09/01/05 11:39

wow, thanks! that was exactly what I was looking for!
thanks a lot! you got 5 stars
Sinthoras
Posted By: dthomsonjava

Re: blender mdl7 exporter - 12/19/05 15:46

Clickon the link an it is taking me to a German Web Page can someone send me the Python Script file.

Regards and Thanks
David Thomson
dthomsonjava@tiscali.co.uk
Posted By: Ambassador

Re: blender mdl7 exporter - 12/21/05 16:42

you can still get it from my web space: www.geocities.com/flashers3/3dgs_mdl7_export.zip
Posted By: Aron

Re: blender mdl7 exporter - 12/21/05 21:06

Thanks a lot. I just ordered the Blender Book 2.3 to learn Blender from the scratch ... I'm sure this Script will be VERY useful.

edit: just forgot a "h"
Posted By: Ambassador

Re: blender mdl7 exporter - 12/22/05 06:56

Quote:

Tanks a lot. I just ordered the Blender Book 2.3 to learn Blender from the scratch ... I'm sure this Script will be VERY useful.




It is! ... Since I'm using it to export all of my models to project Lullaby.
Posted By: Anonymous

Re: blender mdl7 exporter - 02/04/06 17:39

If the other link doesn't work for you, click here to download the mdl exporter for Blender from my server
Posted By: broozar

Re: blender mdl7 exporter - 02/04/06 20:41

it´s all in the WIKI ^^
Posted By: Kotakide

Re: blender mdl7 exporter - 02/14/06 05:49

gooooooood.... man, goooooddd......
© 2024 lite-C Forums