M3 Import plugin
Starcraft 2 Model (.M3) import plugin for 3ds Max
A Starcraft 2 Model (.M3) import plugin designed for 3ds Max 2010.
Currently Imports:
- Geometry
- Bones
- Materials
- Animation
If you use any of the code, please provide credit where it's due.
Install instructions
1. Must have 3ds max installed
2. Extract the script (.ms) into your 3ds max '...\Scripts' directory, optionally you can place the script in your '...\Scripts\Startup\' directory to have it automatically load when you launch 3ds Max.
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.
4. Select 'M3 - Import' from the Utilities drop down menu. From there, use the UI to locate the M3 you wish to import and so on.
Note: When importing models, .dds maps can be automatically applied to the model but you must first setup a map path in 3ds max. To do this, use the menu 'Customize->Configure User Paths...', click on the 'External Files' tab and add the path. The script will check each path until it finds the correct map.
5. Control the Animation Sequences through 'M3 - Sequences' found in the utilities drop down menu.
Enjoy!
Known bugs
- Model mesh still does not bind to the bones properly for some models (eg. Immortal.m3).
- 3ds Max can be slow importing some of the larger models if you choose to import animation sequences. This is due to the inherently sluggish nature of maxscript, import animations at your own peril.
- Some animations are still not animating correctly.
- Vertex normals at the moment are SLOW to import due to 3ds max being crappy about how to manually set them. For large models it will slow down the import considerably.
Special Thanks
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!
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.
what map path do i set up? I guess i am confused on the "Add map path" part. I know how to navigate to it, just not sure what to input when I click "Add" in the "External" tab. Also, when I open a file from Assets/..., say for instance, a siege tank, all settings are selected under "Settings" and FPS is set to 30, yet when I click "Import" I get the usual "textures won't come with", I write down the texture files, click "Yes", then I get error message: "Import failed Unknown property: "position" in undefined. any thoughts? I use 3ds Max 2011 and I am able to import meshes when only "Import Mesh" is selected in "Settings". thanks in advance.
Goobs
Try to import m3 file, and there are errors: can't convert bool to float at sc2_objects.ms 804
on U_Tile set val do delegate.coords.U_Tile = val
Too bad it doesn't seem to work with Gmax.
like i ran script selected the m3 import and then no dialog box comes up or nothing
Cant get this script to work i get this when i try to open stuff:
43DM F nul nul nul nul nul nul nul nul nul nul nul nul
Can anyone help me with 3dsmax 2010? i want to scale the imported model but it is scaled only for the first/active frame. how can i do it for the whole animation?
y the download here is not aktuell! got it from an other post/thread here. page 25 of a thread.
€: here it is: http://www.sc2mapster.com/assets/m3-export-plugin-3ds-max/files/24-m3-plugins-v1-7b/
I love this! But I was wondering if you knew what would be the problem if 3d Max couldn't read the script? I get to the point of importing the M3 file and it says the model is not a valid Starcraft2 model. I realize this is the point where the error occurs, but their is no 'yes' or 'no' option, only 'ok'. Did I load the wrong script or something?
Ok, so I am totally new to all of this, but if someone could help me that would be incredible. All I'd like to do is recolor the Archon model with some reds and purples to make a Dark Archon. I've made the functionality of the Dark Archon in the editor already, but 3ds max just seems to be far above my current expertise. I edited the texture for the cloud around the Archon and recolored it, but now I can't figure out how to import that .dds file back into 3ds max and then apply it to the model. Any help?
@MrMoonKr Ah thanks, I unknowingly used that function even though it's not backwards compatible. I've been striving for backward compatibility, so I'll include your 'myToUpper' function in the next update with your permission. I can explain it to you, but you're pretty much there already if you can build the bind pose properly.
In 3ds max to do animations, I sorted the bones by depth and animated the bones of least depth first, going down the chain doing the root bones last. For translation data, you're just moving the bone in the parents coordinate system to where the key specifies.
Rotations are trickier. I had to use a different approach to get them to work properly. I can't fit a full description here but if you want the details PM me and I'll try to explain. I'm not sure how to do it all in directx, just how to make it work in 3ds max :)
edit: thanks, it works now.
@NiNtoxicated01
i am in the middle of making model view using directx
i wonder how should i calculate animation data
i succeeded in making bind pose and bind pose pivot
but , failed in animating bone
can you teach me how should i rebuild bone with animation data ? ^^;
@tFighterPilot
make function like below and change toUpper to myToUpper
fn myToUpper str =
(
if str == undefined do return undefined
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lower = "abcdefghijklmnopqrstuvwxyz"
outstr = copy str
for i = 1 to outstr.count do
(
j = findString lower outstr[i]
if j != undefined do outstr[i] = upper[j]
)
return outstr
)
Help, whenever I try to import any m3 model I get "Type error: Call needs function or class, got: undefined"
It stops on id = toUpper tagID
I have 3DS 9
Sorry ! It work !
@ghsi123: .m3 files are found in your Starcraft 2 directory, in the Mods\Liberty.SC2Mod\base.SC2Assets MPQ file. You'll need an MPQ extractor to access them.
@GoldenBARS: Why can't you run it? Describe the problem.
I can't run it =(
Where can we find the .m3 files?