M3 Plugins for 3ds Max
Starcraft 2 Model (.M3) Plugins for 3ds Max
Starcraft 2 Model plugins. Tested on 3dsmax 2009, 2010, 2011 and 2012.
3dsmax 2013 is not supported!
The importer and exporter will now be bundled together along with Starcraft 2 object definitions for using custom objects (materials, maps, UI, etc) within 3ds Max. I've chosen to distribute them together so that the object file definitions are in sync with each script.
Starcraft 2 Model (.M3) import plugin for 3ds Max
Currently Imports:
- Geometry
- Bones
- Materials (Standard, Volume, Displace and Terrain)
- Animation
- Attachments
- Particle Emitters
- Cameras
- Lights
- Ribbons
- Tight and Fuzzy hit tests
Starcraft 2 Model (.M3) export plugin for 3ds Max
Currently Exports:
- Geometry
- Materials (Standard, Volume, Displace and Terrain)
- Skin\Bones
- Animations
- Attachments
- Particle Emitters
- Cameras
- Lights
- Ribbons
- Tight and fuzzy hit tests
Setting up an exportable model
Geometry & Materials
- Geometry to be exported must be of the 'Editable_Mesh' type.
- Materials can only be of 'Starcraft 2', 'Standard' or 'Multimaterial' types. Starcraft 2 type is highly recommended.
- Bitmaps must be either 'Starcraft 2 Bitmap' or 'Bitmap' type. Starcraft 2 Bitmap is also highly recommended.
- Decals can now be exported. They are applied through a different UV map channel to the diffuse map.
- In Displace Material, Global strength works as a multiplier of Strength Map. Can be animated. If set to 0, no effect will occur but the higher it goes the more displacement will be visible.
You can now use custom 'Starcraft 2' materials and 'Starcraft 2 Bitmap' bitmaps for extra tweakable settings if you put the sc2_objects.ms script in your plugins directory.
Skin, Bones and Attachments
- Vertices must be weighted via a skin modifer applied to a mesh. This is not required for meshes that have no weighted vertices.
- Attachments are now exported as custom helper objects. They can be found in the Create panel, under the Helpers tab in the 'Starcraft 2 Objects'*s group.
- Unskinned geometry and helper objects that aren't hidden or frozen in the scene will be exported as bones.
Rather important!
Every object needs to have a bone attached to it. To save time on that you have an option in M3 - Export menu called "Add bones". Please, always add bones, script will not do it for you any more. "Add bones" creates and attaches parrent bone at the pivot point of a selected object. If it is helper (Pemitter, Ribbon etc), the helper will be attached to it. If it is mesh, script will create Skin modifier and add newly created bone.
Bindpose Rigging
The bindposes for Starcraft 2 models exists in two forms, the bind pose and the base pose. The first form is the bind pose of the model which uses the absolute positions of the bones and the mesh vertices before any deformation as the 'binding' of bones to mesh pose. The base pose of the model is the 'standard' pose of the model that animations are based off and uses the bind pose as the initial reference. This is the pose the model will assume in the absence of animation information. The base pose and bind pose do not need to be different, they can be the same, this is just the system Starcraft 2 models use to rig bones to model meshes. You can set these poses up at different frames and assign them through the exporter options.
Animations
Animations are now supported by the exporter, however make sure you create beginning and end frame animations for the bones you're going to animate or else you'll be getting weird interpolations. When doing rotation animation, keyframes should be provided every 90 degrees or less of rotation. Animations may not export entirely like you expect because the code is still largely beta.
Cameras
To export Cameras properly you need to create targeted camera. Middle point for DOF functions is deifned by the target position.
Environment ranges define DOF falloff start and end.
Clip planes for the StarCraft to handle are defined by the Clipping Planes values.
Lights
Exported lights must be of "SCII Light' type
Make sure to properly set up the ranges and spot (only in case of a spot light) parameters of the light
Every added light has to be linked to the bone
Ribbons
Ribbons include very similar interface to that of particle system.
It has to have a bone and a material associated with it.
Tight and fuzzy hit tests
Just like any other helper and object, it needs to have a bone attached.
The difference is that it does not take transform information directly from the bone.
Instead, helper's transformation is added into the bone's transformation. The resulting transformation is what you see in game.
Version 2.2 mini-manual:
http://www.sc2mapster.com/forums/resources/third-party-tools/963-m3-exporter/?page=48#p959**
Version 2.1 mini-manual:
http://www.sc2mapster.com/forums/resources/third-party-tools/963-m3-exporter/?page=39#p774
If you have any bug to report please do it it M3 Exporter thread http://www.sc2mapster.com/forums/resources/third-party-tools/963-m3-exporter/
Install instructions
1. Must have 3ds max installed
2a. Extract the scripts (.ms) into your 3ds max '...\Scripts' directory, optionally you can place the scripts in your '...\Scripts\Startup\' directory to have it automatically load them when you launch 3ds Max.
2b. If you want to use Starcraft 2 objects in max (custom materials, maps, animation UI) then place 'sc2_objects.ms' into your 3ds max '...\Plugins' directory.
3. Click on the hammer icon on the default right hand side pane, and click on the MAXScript button. If you didn't have 3ds max automatically load it upon launch, click 'Run Script' from the rollout dialog and locate the script you want to load.
4. Select the utilty (i.e.'M3 - Import', 'M3 - Export') from the Utilities drop down menu.
Special Thanks
Blue Isle Studio (http://blueislestudios.com/): Have graciously supported the development of these tools. Keep your eyes on these guys in the future and check out their website!
Volcore (http://volcore.limbicsoft.com/): For help with vertice flags and initial architecture of the M3 format
Teal (starcraft.incgamers.com): For UV's and his PHP converter source, helped with geometry importing
Witchsong (http://code.google.com/p/libm3/): Providing a great open source library for documenting the M3 file format and designing the M3->Obj converter. Head to http://code.google.com/p/libm3/ for more M3 file spec details. Helped immensely figuring out the details of the M3 file format.
Sixen (http://www.sc2mapster.com/): An awesome website for hosting SC2 development tools and vast XML documentation.
der_ton (http://www.doom3world.org/): Has done some incredible work with the MD5 format. Alot of his work has been adapted for the M3 file format with great success. Big thanks goes out to him!
MrMoonKr: Providing a toUpper function to fix 3ds max incompatibility issues
Skizot: For testing and providing suggestions to improve the script, very big thanks
Phygit: Providing bug fixes and development information to do with the M3 format
ufoZ: One of the original crew to reverse engineer the M2 format and provide a good maxscript importer from which my importer/exporters are based. Huge thanks to his efforts.
Jakub Jeziorski
Florian Köberle (https://github.com/flo/m3addon/) : for creating python scripts, that can convert m3 files to xml and back based on a xml description of the m3 file format.
Perhaps a stupid question, but when exporting a model with animations, how do I specify which animations are where? Which frames are 'stand', 'death', etc? If someone could help me out I'd be much appreciative.
Exporter works great, though. Thanks for making this.
Installed everything but I get nothing in the utility drop down menu. I'm running max 2010 64bit. Could x64 be the cause of this problem, if so, can this be fixed? Thanks
Great plugin, but i have a question.
I imported a SC2 model in 3ds max, i can see the list of sequence animations and stuff, however, saving, closing and opening 3ds max again, i don't have access to the sequences anymore, is it possible to see them again or it's not supported yet?
Thanks.
err anyone else at all have experience or knowledge about how to fix the problem with the textures appearing?
uhh, i don't know much about 3ds max, but try applying materials to the model.
And to get the m3 files u can either export them individually with the previewer or use Ladik's MPQ editor to extract the files from the SC2 assets.
Getting the model in, but not the texture. Tried moving it to the maps folder in the 3DS directory, a change is effected but I wouldn't call it a success, just reflects light differently, but still no colour. So the geometry is fine, its really just the texture, how do I view it exactly as it'd be in game? I am using the Mapsterlogo.m3 from the doodads tutorial as an example.
Also, question #2: How do I find all the .m3 files for the default game models!? (ie: Marine, Zealot, etc)
i couldn't find a exporter script either, but there are two import scripts.
that sucks, it looks like you forgot to include the m3 exporter script in the zip. :(
Lol so funny seeing my video floating around.
@Teny2: Are you putting sc2objects.ms in your 3dsmax\Plugins directory? Think that's what might be causing you problems. Make sure that's in that directory then restart 3ds max or evaluate it through the maxscript UI.
With material type as "Standard" and bitmap type as "Bitmap" it still gives me the error Unknown property: "materialType"... Any tips?
I exported a game model from the galaxy editor and tried to import it using your script. It was unable to load any textures. With import materials unchecked, it just gives an error and does nothing.
So, how can I get the import or export to work? Currently neither do anything.
@cielo12
You must either run the scripts via the 'Run Script' button in the maxscript tab or place the scripts in your '...\3ds Max\Scripts\Startup' directory so that they run on startup. You've placed them in your '...\3ds Max\Scripts' directory but they're not being run. You have to run them manually and they'll appear in the Utilities menu.
I have the same problem as XYZMuffin. The utilities to select from only shows M3 animations, but doesn't have an export option. What am I doing wrong? Thanks.
Where Do You Put The DDS Textures?
god like! thanks
did i do somthign wrong? or is it the same for everyone els?
in your latest lrelease there is no export option!
hi, thank you so much for developing this plugin.
I'm currently trying to export a custom unit but im having a problem.
he's rigged and all the animations work, but when i go to export i get this
Export failed!
Unknown property: "parent" in undefinedany idea of why this might be?
@SmokeFX: Make sure you convert your mesh in the scene to an editable mesh otherwise the exporter won't pick it up. Other mesh types aren't supported at the moment but may be in the future I guess.
@therockman: Hey man! Good to see you still around. No-one else left that cares about the M3 format that I can tell so I stopped updating libm3. I can update it for ya, the MD34 format is almost identical to the MD33 format, just some extra int's for reference, sphere and matrix data types (presumably flags for the previewer but I've never seen them any other value than 0). I recommend checking out the template I've got up for the 010 editor, you can find it here. I update the template as I figure things out, so it's most up to date. At some point I'll update the libm3 too.
As for attachments, they'll only really work if you use certain names for them, such as Ref_Target or Ref_Weapon. Sometimes you can add numbers to them too, like Ref_Weapon 01 but there's only certain names that are allowed otherwise you'll get invalid in the previewer. Preview some other models for the naming convention if you're really keen on having some diverse attachments.
I have a big, big update coming along for the importer/exporter. Decals will be supported among other things. It'll make things much less restrictive with how you make models. You'll be happy to know therockman I figured out what those extra data fields were in the vertices. They're extra UV coordinates used to map more than one texture to a mesh. The extra UV coords are usually used for things such as decals, but I've found other maps that use them too. It's good to see you still around man I hope you continue to contribute to the community.
Im having a stupid issue on my part, i presume. Anyway while exporting I get a runtime error saying no meshes found, while I just made a mesh and am trying to export. Please help