I haven't encountered that error. If you could provide me with the model through PM it'd go a long way to helping me troubleshoot the problem. I don't have direct access to cataclysm so I can't test it myself.
Agreed, I would prefer a straight conversion from M2 -> M3 using CPP. It would be quick and flow better. You could incorporate the MPQ libraries and so access the WoW MPQ's directly much like WMV does. You could also implement some kind of DDS library which would automatically convert .blp files to the appropriate .dds format. It would still need some kind of interface though, which is why WMV is probably the best way to go. Perhaps you could add an export to M3 function to WMV. Infact that sounds like a great idea, considering the framework is already there for exporting to other formats. You'd still need to remove meshes associated with glows and particles, but since you've got WMV already parsing the model file you could easily choose not to export them out through WMV.
I think that's possibly the best option, a straight export option from WMV. You could have UI associated with it that woud allow you to select what animations to export and such, similar to how my M2 importer works. I'll look into it though I'm not well versed in CPP so I don't think I could code it quickly. I think it could pretty easily be done though for someone that's good with CPP and it'd make things much simpler, rather than having to import the M2 and it's cavalcade of associated files into 3ds Max to export to M3.
Perhaps the WMV developers can help you, but most likely not. You could theoretically create an M2 file that has the unneeded submeshes absent, but that would mean creating an M2 export library which would be a pain in the arse. What WMV does is read in raw M2 files and interpret the data. When you click extract, you're just extracting the raw M2 and its associated files that WMV interprets with the help of DBC definitions and such. I'm pretty sure exporting to their other formats (.fbx, .obj) would preserve the geometry you have rendered only. Infact from what I've read FBX works pretty well.
The best solution would be to improve my importer script so that it interprets the M2 raw data in a similar fashion to WMV rather than have WMV cater to the importer script. If I get time I'll look into supporting this functionality so that the flow is simplified.
Extensive documentation of the M2 file format can be found at madx's wowdev wiki and within the WoW Model Viewer source code. My source code for the importer may also be of assistance in understanding how to treat the file format. MDX documentation is available at a variety of sources, a google search will help you if you're interested in parsing the format.
Some M3 documentation can be found at libm3, though some of it is out of date. I'll be updating alot of it when I get the chance. There's a 010 template for the 010 Hex Editor available for download that can give you a good idea on how the file format is parsed and can be found in the downloads section.
If you're getting extra meshes then they're defined within the model file and not an error with the importer nor WMV. There are a few reasons you may be getting extra meshes:
Character models use extra meshes for different hair/face styles. They also use different meshes for different items which is how capes, boots, bracers and belts are shown on WoW models. Through DBC definitions certain meshes are switched on or off in the game engine, which is why you normally don't see all these meshes at once in game. My only solution for the moment is to just delete the meshes you don't want as annoying as that can be. As has been mentioned earlier, you can grab the combined 'Skin' texture for characters by exporting as .obj in WMV which will create a baked texture of your character in WMV for you. You can discard the .obj model file and use the created texture for your model in 3ds Max.
Particle/Ribbon emitters sometimes have associated meshes. At the moment, since particle/ribbon emitters are not supported, you'll just have to delete these meshes.
Some meshes are used for 'glow' effects. Basically they're not currently converted to any kind of format that the M3 exporter can handle so they should be deleted.
I don't contribute code to WMV so I can't speak for the problems that it has. I've noticed that the export all and export all to TGA options are not perfectly implemented and you can get alot of junk through that method, but it beats having to extract the files from the various MPQ's by hand and convert them yourself. I would like to add character support to the importer so that you have more control over what meshes are imported but I don't have the time to implement such a feature presently.
I appreciate the thanks, though the model format is well documented it is still an intricate task to design an importer that handles the various files involved.
That looks like the keyboard texture that the engine uses when a model references an invalid texture. This must mean you have:
Not imported the textures to the map in the right path (Import them into 'Assets\Textures\' folder in the import window by default)
Haven't added the correct texture in 3ds Max so the internal filename is being saved into the M3
If the textures are being applied properly in 3ds Max, and you're resaving the textures as 32 bit in photoshop, then you must not be importing the texture into the map correctly. The default 'internal directory' set in the M3 exporter is used to define what folders you'll be placing the textures into within your map. By default it's 'Assets\Textures\' and if you don't import textures into this folder in the map the M3 will incorrectly reference the texture and you'll get the funky keyboard texture you're seeing in the screenshot.
For example, if you're trying to apply the map 'Worgen_diffuse.tga' to your model you'd first apply the texture to your model in 3ds Max so that the model exports with the path properly. Then in your map you'd import the TGA and place it in the 'Assets\Textures\' path and THEN import the model. If you import the texture first, the model should appear in the editor textured.
Bare in mind when importing some M2's there are meshes that are relevant to particles which should be removed and for characters there's meshes that are only present with certain character configurations (setup in the DBC files, if I update this further in the future I'll most likely add better support for importing characters).
I'm back at uni now and with the game released I'm leagueing quite a bit with what little spare time I have. It's doubtful I'll be able to provide any updates to the plugins for awhile but I still do have plans for them in the future.
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 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.
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 ><
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
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
@justdanze: Go
I haven't encountered that error. If you could provide me with the model through PM it'd go a long way to helping me troubleshoot the problem. I don't have direct access to cataclysm so I can't test it myself.
@zzPop: Go
Agreed, I would prefer a straight conversion from M2 -> M3 using CPP. It would be quick and flow better. You could incorporate the MPQ libraries and so access the WoW MPQ's directly much like WMV does. You could also implement some kind of DDS library which would automatically convert .blp files to the appropriate .dds format. It would still need some kind of interface though, which is why WMV is probably the best way to go. Perhaps you could add an export to M3 function to WMV. Infact that sounds like a great idea, considering the framework is already there for exporting to other formats. You'd still need to remove meshes associated with glows and particles, but since you've got WMV already parsing the model file you could easily choose not to export them out through WMV.
I think that's possibly the best option, a straight export option from WMV. You could have UI associated with it that woud allow you to select what animations to export and such, similar to how my M2 importer works. I'll look into it though I'm not well versed in CPP so I don't think I could code it quickly. I think it could pretty easily be done though for someone that's good with CPP and it'd make things much simpler, rather than having to import the M2 and it's cavalcade of associated files into 3ds Max to export to M3.
@zzPop: Go
Perhaps the WMV developers can help you, but most likely not. You could theoretically create an M2 file that has the unneeded submeshes absent, but that would mean creating an M2 export library which would be a pain in the arse. What WMV does is read in raw M2 files and interpret the data. When you click extract, you're just extracting the raw M2 and its associated files that WMV interprets with the help of DBC definitions and such. I'm pretty sure exporting to their other formats (.fbx, .obj) would preserve the geometry you have rendered only. Infact from what I've read FBX works pretty well.
The best solution would be to improve my importer script so that it interprets the M2 raw data in a similar fashion to WMV rather than have WMV cater to the importer script. If I get time I'll look into supporting this functionality so that the flow is simplified.
Extensive documentation of the M2 file format can be found at madx's wowdev wiki and within the WoW Model Viewer source code. My source code for the importer may also be of assistance in understanding how to treat the file format. MDX documentation is available at a variety of sources, a google search will help you if you're interested in parsing the format.
Some M3 documentation can be found at libm3, though some of it is out of date. I'll be updating alot of it when I get the chance. There's a 010 template for the 010 Hex Editor available for download that can give you a good idea on how the file format is parsed and can be found in the downloads section.
Good luck :)
@zzPop: Go
If you're getting extra meshes then they're defined within the model file and not an error with the importer nor WMV. There are a few reasons you may be getting extra meshes:
I don't contribute code to WMV so I can't speak for the problems that it has. I've noticed that the export all and export all to TGA options are not perfectly implemented and you can get alot of junk through that method, but it beats having to extract the files from the various MPQ's by hand and convert them yourself. I would like to add character support to the importer so that you have more control over what meshes are imported but I don't have the time to implement such a feature presently.
I appreciate the thanks, though the model format is well documented it is still an intricate task to design an importer that handles the various files involved.
@MangledMind: Go
That looks like the keyboard texture that the engine uses when a model references an invalid texture. This must mean you have:
If the textures are being applied properly in 3ds Max, and you're resaving the textures as 32 bit in photoshop, then you must not be importing the texture into the map correctly. The default 'internal directory' set in the M3 exporter is used to define what folders you'll be placing the textures into within your map. By default it's 'Assets\Textures\' and if you don't import textures into this folder in the map the M3 will incorrectly reference the texture and you'll get the funky keyboard texture you're seeing in the screenshot.
For example, if you're trying to apply the map 'Worgen_diffuse.tga' to your model you'd first apply the texture to your model in 3ds Max so that the model exports with the path properly. Then in your map you'd import the TGA and place it in the 'Assets\Textures\' path and THEN import the model. If you import the texture first, the model should appear in the editor textured.
Bare in mind when importing some M2's there are meshes that are relevant to particles which should be removed and for characters there's meshes that are only present with certain character configurations (setup in the DBC files, if I update this further in the future I'll most likely add better support for importing characters).
I'm back at uni now and with the game released I'm leagueing quite a bit with what little spare time I have. It's doubtful I'll be able to provide any updates to the plugins for awhile but I still do have plans for them in the future.
@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.
@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.
@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 ><
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