Hey guys, due to popular demand I decided to rework my old M2 Importer script for 3ds Max so that it would work with the latest World of Warcraft models (WotLK and Cataclysm). It's been designed for WotLK models but fortunately it seems Cataclysm will not introduce major changes to the model format and so the importer should work just fine once Cataclysm goes live too. You can grab the script bundled with my other M3 scripts here.
I'll need to provide a quick tutorial on how to use the importer as World of Warcraft model files are no longer standalone model files. You have .skin and .anim files in addition to the actual .m2 file. This makes importing messy (especially coding the script, believe me) but there's an easy and quick way to do it. Get a hold of an MPQ extractor, personally I recommend Ladik's MPQ Editor. You'll need to extract a file from your WoW MPQ's if you want your animations to be named. It's called 'AnimationData.dbc', it contains all the names of the animations that WoW uses, and it's located in your language MPQ's (i.e. in Patch-enUS-3.MPQ). Once you're done extracting the file, make sure you close the MPQ so it's no longer being accessed.
Next, grab the latest version of the WoWModelViewer which can be downloaded for free here. Find the model you want to import into max and load it up in the model viewer. Once it loads, go to File->Export Textures...
Now when the new dialog pops up, click on 'Export All' and 'Export All to TGA'. Make sure 'Path Preserved' is unchecked.
The exported files will be located in your WoWModelViewer directory in the 'Export' folder. I recommend cutting and pasting them to another location so they don't get mixed up with future exports. Now head into 3ds Max. When you open up the M2 Importer, you'll notice a settings button you should click on.
In the settings, you should configure the DBFilesClient path to where you extracted the AnimationData.dbc file using the browse button. This lets the script know where to find the file so it can apply the correct names to animations. Important if you plan to export to M3 later.
If you left 'Import as M3' checked in the settings, the script will automatically scale the model for you (half it's original size seems about correct for matching the size of Starcraft 2 Models) and re-orient the model to face the same way as Starcraft 2 models do. An 'm3root_bone' will be created which can be used to alter the position, rotation and scale of the model without affecting animations. Additionally, it will select to import only Attack, Stand, Death and Run animations (which you can alter on import if you wish) and automatically rename them to M3 convention. In order to control animations, you must select 'M3 - Sequences' from the Utility drop down menu in the MAXScript panel.
Attachments will also automatically be created as Starcraft 2 attachments and given appropriate ID's, but it's not perfect as alot of the attachments have ambiguous function in World of Warcraft models. Finally, Starcraft 2 materials will be setup for you based on a rough conversion of the M2 material definitions. I've tried to name the bitmaps so you know what should go where, as some World of Warcraft textures are assigned through DBC definitions and not within the M2 itself.
Hard-coded M2 textures should be automatically applied if they are in DDS, TGA or PNG format and in the same folder as the model. The TGA textures exported from the WoWModelViewer should be fine in Max, but I've found they won't render in the Starcraft 2 editor without being resaved as 32 bit TGA in Photoshop.
If you follow these instructions it should be relatively easy to export any animated M2 to the M3 format to be used as a Starcraft 2 model. Here's a short video showing the power of the importer/exporter combo in-game. I'm not great with the editor but I tried my best to get the concept across. I suck with video editing which explains why the ratio is all off and such when I embed it. Go to the actual video it comes up a bit better :(.
Thanks, I'm trying to fix the stupid ratio now so it embeds properly. I'll try and update it properly, I have a feeling it'll make front page and I'd prefer it didn't look like crap ><
Its really awesome! The only issue Im having is the Textures not showing up in 3dsmax nor the Editor. And those who show up in 3dsmax still doesnt show in the Editor =(
Im probably doing something wrong ( duh ), but when I resaved the .tga as 32-bit it shows up in the editor, but the model does not. And when I didnt resave the .tga the model shows up purple. .. .hmm
You're a goddamn hero. At long last, all the pieces fall together, and now we have...
THE TRIFORCE!
(The three MMO's I'm porting graphics from, of course.)
A little more complex to import than I thought but looks relatively easy once I get used to it. Do note that Blizzard changed Lick King's model format multiple times before release, so Cata's format may yet change again. I doubt it will change a lot though. But I thought that for LK too... I wonder why they started using external files for all this stuff now?
/edit
Out of curiousity, does Sc2 support "gethit" animations at all? I guess I'll have to import twice to get AoW2 and then Sc2 versions, since I'll need gethit animations for the aow2 variants. But that's okay. Or I can just manually configure them I suppose.
edit; i am now selling WoW models for 5$. just tell me the model you want and ill send it to you in a map, or i can add it to your map for you... (this is a joke like last time before anyone nerdrages....)
edit; i am now selling WoW models for 5$. just tell me the model you want and ill send it to you in a map, or i can add it to your map for you... (this is a joke like last time before anyone nerdrages....)
Lame jokes are so much funnier the second time they are posted lol. /nerdrage off
Thanks NIN, this is pretty awesome. Can't wait to see a mini-ragnaros in a SC2 map :P
I wish it wasn't so complex, I'd prefer a straight conversion myself. The problem stems from using maxscript to code the plugin as I cannot use the CPP libraries to access MPQ's. World of Warcraft models can be heavily entangled with DBC definitions, which is how alot of models have different body textures applied without having multiple model definitions. In these instances I've tried to give the bitmaps logical names, such as 'Skin1' which means Creature Skin1 and 'Items' which usually means capes and such.
The people coding WoWModelViewer think they've made the .anim files external to save on WoW memory demands as rarer animations for the model are stored in these files and only called when they're used rather than pre-loaded. The .SKIN files are external because only one of them is used at a time and it is again a waste of memory to have them all defined in the one model when only one is usually needed to be loaded.
I think it'd be alot easier and faster to execute if I coded a CPP plugin converter that can access the MPQ's. That way I could reference the DBC files without having to force the end user to extract any himself. It also means I could access all the .anim and .skin files automatically. Perhaps in the future I'll make something like that but for now I'm a little burned out on all this stuff. Uni break is almost over so my commitment to importers and exporters will not be as solid.
Edit: Sorry IskatuMesk, I didn't realise the activeX controls would create compatibility issues. I'll look into developing a solution. Compatibility errors are the devil.
Edit2: I'm reading about a possible solution here: http://blog.duber.cz/3ds-max/farewell-activex. Converting to dot.net controls instead. If it works properly should be a relatively quick fix. Seems Microsoft pulled the plug on activeX controls, so they're not being compiled in 64-bit.
From what little we know we think it has to do with ActiveX itself being different from 32-bit to 64-bit (I presume you're using 32-bit yourself). I hope you can solve it, in any case. :)
Grab the new script bundle here. Removed all the activeX controls and replaced them with dotnet controls, so everything should work on 64-bit operating systems and 64-bit max. It was a bit of a pain to learn so much about dotnet controls so I hope the hard work is appreciated :P. I'm going to be busy with Uni work soon, so I probably won't be doing much in the way of updating the plugins.
My final goals are to add particle/ribbon support to the importers/exporters, do some tutorials on how to use the plugins and to see about coding something for Blender at some stage. I wish I could program C plus plus programs that would do straight conversions instead of having to use 3ds Max as a medium for conversion too. Doubtful I'll get around to doing that.
Hopefully I can put a tutorial up soon on how to export to the M3 format and get the models properly textured into the Starcraft 2 editor. I'll need more details about your problem to troubleshoot it. Make sure your textures render in the importer window so it confirms the Starcraft 2 editor can understand the texture file. Import textures first then models, and make sure you import textures into the 'Assets\Textures' path or whatever you set the texture path to be in 3ds Max as the internal path. If you have textures properly imported and the model still doesn't appear textured, try restarting the whole Starcraft 2 editor or closing and reloading your map as this is known to fix alot of texture problems.
I was left with the impression that blizzard will provide some model importing tool... is this correct? if so, it will make life a hell of a lot easier
Hey guys, due to popular demand I decided to rework my old M2 Importer script for 3ds Max so that it would work with the latest World of Warcraft models (WotLK and Cataclysm). It's been designed for WotLK models but fortunately it seems Cataclysm will not introduce major changes to the model format and so the importer should work just fine once Cataclysm goes live too. You can grab the script bundled with my other M3 scripts here.
I'll need to provide a quick tutorial on how to use the importer as World of Warcraft model files are no longer standalone model files. You have .skin and .anim files in addition to the actual .m2 file. This makes importing messy (especially coding the script, believe me) but there's an easy and quick way to do it. Get a hold of an MPQ extractor, personally I recommend Ladik's MPQ Editor. You'll need to extract a file from your WoW MPQ's if you want your animations to be named. It's called 'AnimationData.dbc', it contains all the names of the animations that WoW uses, and it's located in your language MPQ's (i.e. in Patch-enUS-3.MPQ). Once you're done extracting the file, make sure you close the MPQ so it's no longer being accessed.
Next, grab the latest version of the WoWModelViewer which can be downloaded for free here. Find the model you want to import into max and load it up in the model viewer. Once it loads, go to File->Export Textures...
Now when the new dialog pops up, click on 'Export All' and 'Export All to TGA'. Make sure 'Path Preserved' is unchecked.
The exported files will be located in your WoWModelViewer directory in the 'Export' folder. I recommend cutting and pasting them to another location so they don't get mixed up with future exports. Now head into 3ds Max. When you open up the M2 Importer, you'll notice a settings button you should click on.
In the settings, you should configure the DBFilesClient path to where you extracted the AnimationData.dbc file using the browse button. This lets the script know where to find the file so it can apply the correct names to animations. Important if you plan to export to M3 later.
If you left 'Import as M3' checked in the settings, the script will automatically scale the model for you (half it's original size seems about correct for matching the size of Starcraft 2 Models) and re-orient the model to face the same way as Starcraft 2 models do. An 'm3root_bone' will be created which can be used to alter the position, rotation and scale of the model without affecting animations. Additionally, it will select to import only Attack, Stand, Death and Run animations (which you can alter on import if you wish) and automatically rename them to M3 convention. In order to control animations, you must select 'M3 - Sequences' from the Utility drop down menu in the MAXScript panel.
Attachments will also automatically be created as Starcraft 2 attachments and given appropriate ID's, but it's not perfect as alot of the attachments have ambiguous function in World of Warcraft models. Finally, Starcraft 2 materials will be setup for you based on a rough conversion of the M2 material definitions. I've tried to name the bitmaps so you know what should go where, as some World of Warcraft textures are assigned through DBC definitions and not within the M2 itself.
Hard-coded M2 textures should be automatically applied if they are in DDS, TGA or PNG format and in the same folder as the model. The TGA textures exported from the WoWModelViewer should be fine in Max, but I've found they won't render in the Starcraft 2 editor without being resaved as 32 bit TGA in Photoshop.
If you follow these instructions it should be relatively easy to export any animated M2 to the M3 format to be used as a Starcraft 2 model. Here's a short video showing the power of the importer/exporter combo in-game. I'm not great with the editor but I tried my best to get the concept across. I suck with video editing which explains why the ratio is all off and such when I embed it. Go to the actual video it comes up a bit better :(.
Cheers,
- NiN
WOOT.
Great vid btw, lol
@acidragoon: Go
Thanks, I'm trying to fix the stupid ratio now so it embeds properly. I'll try and update it properly, I have a feeling it'll make front page and I'd prefer it didn't look like crap ><
@NiNtoxicated01: Go
This looks incredible. Great work.
Hm hm.
Awesome man, that's so sick =D
Its really awesome! The only issue Im having is the Textures not showing up in 3dsmax nor the Editor. And those who show up in 3dsmax still doesnt show in the Editor =(
Im probably doing something wrong ( duh ), but when I resaved the .tga as 32-bit it shows up in the editor, but the model does not. And when I didnt resave the .tga the model shows up purple. .. .hmm
@NiNtoxicated01: Go
You're a goddamn hero. At long last, all the pieces fall together, and now we have...
THE TRIFORCE!
(The three MMO's I'm porting graphics from, of course.)
A little more complex to import than I thought but looks relatively easy once I get used to it. Do note that Blizzard changed Lick King's model format multiple times before release, so Cata's format may yet change again. I doubt it will change a lot though. But I thought that for LK too... I wonder why they started using external files for all this stuff now?
/edit
Out of curiousity, does Sc2 support "gethit" animations at all? I guess I'll have to import twice to get AoW2 and then Sc2 versions, since I'll need gethit animations for the aow2 variants. But that's okay. Or I can just manually configure them I suppose.
way to go. thanks!
edit; i am now selling WoW models for 5$. just tell me the model you want and ill send it to you in a map, or i can add it to your map for you... (this is a joke like last time before anyone nerdrages....)
Omg this is amazing :D woohoo!
Lame jokes are so much funnier the second time they are posted lol. /nerdrage off
Thanks NIN, this is pretty awesome. Can't wait to see a mini-ragnaros in a SC2 map :P
the animations seem to work great too!
i see a WoW RTS map in the future.
haha, it's awesome. Good job.
http://www.youtube.com/user/RussianMapster
Got a funky error. Tried to import the icebound drake mount and got this.
Jumped to this line;
2736 DestroyDialog WOW2_ModelUI
/e Okay, it's giving me the exact same error with the JormungarLarva too..
/e 2 My friend is also getting that error.
/e 3 Okay, it looks like this doesn't support 64-bit version of max (neither with 2009 or with 2010). For me that creates... major complications. :(
@IskatuMesk: Go
Looking into the problem now...
I wish it wasn't so complex, I'd prefer a straight conversion myself. The problem stems from using maxscript to code the plugin as I cannot use the CPP libraries to access MPQ's. World of Warcraft models can be heavily entangled with DBC definitions, which is how alot of models have different body textures applied without having multiple model definitions. In these instances I've tried to give the bitmaps logical names, such as 'Skin1' which means Creature Skin1 and 'Items' which usually means capes and such.
The people coding WoWModelViewer think they've made the .anim files external to save on WoW memory demands as rarer animations for the model are stored in these files and only called when they're used rather than pre-loaded. The .SKIN files are external because only one of them is used at a time and it is again a waste of memory to have them all defined in the one model when only one is usually needed to be loaded.
I think it'd be alot easier and faster to execute if I coded a CPP plugin converter that can access the MPQ's. That way I could reference the DBC files without having to force the end user to extract any himself. It also means I could access all the .anim and .skin files automatically. Perhaps in the future I'll make something like that but for now I'm a little burned out on all this stuff. Uni break is almost over so my commitment to importers and exporters will not be as solid.
Edit: Sorry IskatuMesk, I didn't realise the activeX controls would create compatibility issues. I'll look into developing a solution. Compatibility errors are the devil.
Edit2: I'm reading about a possible solution here: http://blog.duber.cz/3ds-max/farewell-activex. Converting to dot.net controls instead. If it works properly should be a relatively quick fix. Seems Microsoft pulled the plug on activeX controls, so they're not being compiled in 64-bit.
@NiNtoxicated01: Go
From what little we know we think it has to do with ActiveX itself being different from 32-bit to 64-bit (I presume you're using 32-bit yourself). I hope you can solve it, in any case. :)
Does anyone have any tips on importing Custom Models into SC2?
Im importing the Model and Textures linked to the model, but the model still uses the default Purple-ish texture. =(
@IskatuMesk: Go
Grab the new script bundle here. Removed all the activeX controls and replaced them with dotnet controls, so everything should work on 64-bit operating systems and 64-bit max. It was a bit of a pain to learn so much about dotnet controls so I hope the hard work is appreciated :P. I'm going to be busy with Uni work soon, so I probably won't be doing much in the way of updating the plugins.
My final goals are to add particle/ribbon support to the importers/exporters, do some tutorials on how to use the plugins and to see about coding something for Blender at some stage. I wish I could program C plus plus programs that would do straight conversions instead of having to use 3ds Max as a medium for conversion too. Doubtful I'll get around to doing that.
@jakpe: Go
Hopefully I can put a tutorial up soon on how to export to the M3 format and get the models properly textured into the Starcraft 2 editor. I'll need more details about your problem to troubleshoot it. Make sure your textures render in the importer window so it confirms the Starcraft 2 editor can understand the texture file. Import textures first then models, and make sure you import textures into the 'Assets\Textures' path or whatever you set the texture path to be in 3ds Max as the internal path. If you have textures properly imported and the model still doesn't appear textured, try restarting the whole Starcraft 2 editor or closing and reloading your map as this is known to fix alot of texture problems.
I was left with the impression that blizzard will provide some model importing tool... is this correct? if so, it will make life a hell of a lot easier
There's probably nothing wrong with the script, only my ability to Import Models ^^
I Imported the Textures first after making them 32-bit with the Assets/Textures path. Then I imported the model.
Now I can preview it and see it in the editor. But the textures doesnt render in-game.
Again, my ability to blame, any ideas? ^^
Ive restarted the editor etc etc.