Blender Exports to Allegiance MDL

Discussion area for user-created Allegiance models, textures, voicechats, music, and other ingame content.
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

Video Example
http://youtu.be/vD6q68exNm8

The project. Get the code here, and then help!
https://code.google.com/p/blender-to-al ... -text-mdl/

Why?

I believe an Exporter for Blender (http://www.blender.org/) is the best possible content pipeline for getting art assets into Allegiance.

Allegiance has a file format called MDL. It has a very similar syntax to JavaScript. It has a text representation and a binary representation. Both types have the same capabilities. The tool MDLC can load a MDL file and write out the binary format of that file to reduce file size.

Exporting to the Text-MDL format is the best thing we can do because it allows the export plugin to utilize all of the Allegiance engines features. The text MDL format can also be extended, as it has been to load .X files. It supports animated images, multiple Levels of detail. It can be used to load textures, I believe it support animated models (I have not tested it). Its very functional, and did I mention it looks like JavaScript?

Why blender? It’s free, open source! It can import, or has importers for tons of other file types. It’s also feature rich.

So take a look at the video example I posted, and then help with the export script. It’s Python and I don't know Python. So the script is ugly and needs someone who loves Python to give it some.


Video Example
http://youtu.be/vD6q68exNm8

The project. Get the code here, and then help!
https://code.google.com/p/blender-to-al ... -text-mdl/
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
Adaven
Posts: 1959
Joined: Sat Oct 25, 2003 7:00 am
Location: Greater Ozarks

Post by Adaven »

If I understand you correctly, this would write directly to a text mdl file? So as far as this might interact with the original MS tool chain, we could still take your text mdl and feed it into MDLC to get optimized and compiled objects?
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

Adaven wrote:QUOTE (Adaven @ Mar 18 2012, 10:13 PM) If I understand you correctly, this would write directly to a text mdl file? So as far as this might interact with the original MS tool chain, we could still take your text mdl and feed it into MDLC to get optimized and compiled objects?
Yes you could.

You also have the option of skipping MDLC, say for testing. Let you maybe manually tweak some stuff before you run it through MDLC.
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

Here is a patch file to fix a few bugs in the text-mdl loading code for Allegiance/MDLC/MDLEdit

Code: Select all

Index: src/effect/efapp.cpp
===================================================================
--- src/effect/efapp.cpp    (revision 1033)
+++ src/effect/efapp.cpp    (working copy)
@@ -292,7 +292,8 @@
 
         TRef<IObjectList> plist;  CastTo(plist, (IObject*)stack.Pop());
 
-        while (plist->GetCurrent() != NULL) {
+        plist->GetFirst();
+        while (plist->GetCurrent() != NULL) {
             IObjectPair* ppair; CastTo(ppair, plist->GetCurrent());
 
             Color  color    =  GetColor(ppair->GetNth(0));
@@ -339,7 +340,8 @@
         TRef<FrameDataListValue> plistValue = new FrameDataListValue();
 
         TRef<IObjectList> plist;  CastTo(plist, (IObject*)stack.Pop());
-
+        
+        plist->GetFirst();
         while (plist->GetCurrent()) {
             IObjectPair* ppair; CastTo(ppair, plist->GetCurrent());
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

indeed mdledit is a good place to start testing your exporter and adapting the engine to use it. but remember xmunge? we dont have the src code to that (part of the artwork toolchain used in orig) so....i forget anyways the dejavu is mind numbing and a true test of patience and will. ;)
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Adaven
Posts: 1959
Joined: Sat Oct 25, 2003 7:00 am
Location: Greater Ozarks

Post by Adaven »

Imago wrote:QUOTE (Imago @ Mar 19 2012, 10:46 PM) But remember xmunge? we dont have the src code to that (part of the artwork toolchain used in orig) so....i forget anyways the dejavu is mind numbing and a true test of patience and will. ;)
I was about to start a thread on this while I was getting info on the original tool chain for the wiki. I can see it in R4 and earlier: http://svn.alleg.net/svn/Allegiance/tag/FA...unge/xmunge.cpp. Why did xmunge go away in R5 and beyond?
Last edited by Adaven on Wed Mar 21, 2012 12:46 am, edited 1 time in total.
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

orig used Direct X Retained mode which is no longer supported in the latest DX SDK

http://support.microsoft.com/kb/969150
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

Imago wrote:QUOTE (Imago @ Mar 21 2012, 04:26 AM) Direct X Retained mode
That's the one - the name I couldn't remember.

Did a quick google found this: http://www.mvps.org/directx/faq/direct3d_rm.htm
QUOTE Some high-end 3D modeling/animation packages come with a DirectX exporter, for example, SoftImage3D. You can directly export your animation work to a .X file by using these exporters. However, if the software you are using do not have a DirectX exporter, you will need to output your work to 3DS format, then use a program called "conv3ds" (comes with DirectX SDK) to convert the 3DS file to .X file. When using "conv3ds" to convert the animation, you should choose the "-A" option. (Note: it's a UPPER case 'A'[/quote]
Pretty old stuff, but may be a solution for people with 3ds max (or software that exports .3ds - [maybe just old .3ds I don't know if the format has changed]) assuming we can get hold of a conv3ds.exe from an old dx SDK - I seem to have a copy of the march 2008 installer, that might be old enough to have a copy in given the date on that support page is march 2009.

edit: ooh a direct x retained mode format document http://paulbourke.net/dataformats/directx/

edit2: found a conv3ds.exe in http://www.microsoft.com/download/en/detai...=en&id=8963
Last edited by madpeople on Mon Apr 02, 2012 11:03 pm, edited 1 time in total.
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

Upgraded for blender 2.6.3

Added addon support.



Currently Supports

Multiple Meshes per modelSingle texture per Mesh.Export as text-mdl

Todo:
CVH ExportHardpoints Export

Looking for someone who knows more about blender then I do to give me an example of making bones and labeling them so I can write the HardPoints export.
Also if anyone knows how to create a convex hull in blender, would be a huge help.

I'm thinking that if the CVH was done it a way that is its visibility is a simple toggle, that would be nicer for the modeler than "just another mesh".


Anyways.. links to help/download are in the first post.
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
TheAlaskan
Posts: 2256
Joined: Tue Apr 03, 2007 2:15 am
Location: Denver, CO

Post by TheAlaskan »

I'm all over hardpoints (for you, Blake). I had a major breakthrough last night regarding how to add them together under a single mesh. Making sure that the mesh has a legitimate convex hull is still under investigation, and any Blender folks out there that can help would be appreciated.
Post Reply