This tutorial will show you how to convert a .m3 file exported from SC2Editor to .xml and edit it. Since the reason why I made it is that somebody asked me how to change an effect color, I'm also highlighting the relevant fields for that task used by effect models (particles, materials and lights - And now I've realized that I've missed the ribbons -).
I've splitted it in 17 steps, but the relevants are the last 7. At the end of the post you'll find an image that might help you if you're stuck in a step.
step 1: Get blender (I use 2.69 , but I believe that println's addon works with any version).
step 6: Copy m3addon-master folder from the addon to blender folder under (version)/scripts/addons. Keep another copy of the folder at hand, you'll need it.
step 7: Open blender and go to file -> user preferences. Write m3 in the search bar, and mark Import-Export: Importer and exporter for Blizzard's Starcraft 2 model files (*.m3).
step 8: Go to file and click on save startup file (to avoid having to configure the addon every time you open blender).
step 9: Go to file -> import -> starcraft 2 Model (.m3) and search for your model.
step 10: Search for the scene icon on the bar at the right. You should find the sections M3 Particle Systems, M3 Materials layers (this one changes when the materials are selected in the M3 Materials section) and M3 lights. Those are the ones that generally have fixed colors.
Well, you thought that you only have to change the materials and export the models back? Well, not. blender messes with the particle systems when reexported. You'll have to edit an xml file.
step 11: Run cmd and enter into the folder you've saved in step 6. The only files needed are the ones in the screenshot. With those you're ok.
step 12: Run m3toxml.py (name of the model). It will convert it to xml
step 13: Open the xml and search for the texts:
For Lights: lightColor
For particles: InitialColor1 InitialColor2 MiddleColor1 MiddleColor2 FinalColor1 FinalColor2. The particles are in the same order that they appear in blender, so follow it and you'll know what to edit.
For materials: search for the name of the material with the colored layer, and under it for the corresponding layer.
step 14: Replace the colors for the ones you like. To find out which is the color code, modify the model with blender, export it with other name, convert it to xml and copy the code that appears where you made the modification.
step 15: Save.
step 16: run xmltom3.py (name of the model.xml) over the xml file.
Another subject, in the model Robotics Facility do u know how to fix the deformation textures in the run scene?
If u did will be nice to u give us a tip. (I’m trying to make a robotics facility Dark and Warp Robotics facility Dark.) I will try to get the gateway sphere and replace it for the pentagon’s sphere in Robotics Facility.
I can not show u a picture becouse (An error has occurred while trying to save the file you uploaded: You have exceeded your maximum upload limit of 4.77 MB. This limit is based on your highest role on the site.)
But hope u be aware of the textures deformation after exported.
Oh, that's what I was saying in the first post. Blender messes with the particle systems. If you have experience with 3dMax, I recommend you to use it, since is the official modelling program.
I see that the mesh deforms too, that's because there are a couple of vertexes incorrectly glued.
Check out the vertex groups in edit mode. Select only Bldg_Protoss_RoboticsFacility_09_L and Bldg_Protoss_RoboticsFacility_08_L and duplicate them (ctrl +d). Then replace the originals with the duplicates. They should not be glued anymore.
Ok, Left arm ready and Hex ready was a nightmare of work to fix each Hex, took me almost 4 Hrs.
I must keep going now with some attached Vertex in pulse. If u know what and where is the problem let me know, for now I’m searching. And after that will be ready.
Another problem to be fixed is the Decal in Robotics Facility Support Bay and in the Pylon Xp Reward. I’m using Blender. Hope u know too how to work this out.
All this is for my A.I. Mode 6 years working slowly on it.
And all this is because the decal and textures Units, Effects, Buttons. All have to be done in the best quality I can. AI Zerg’s change on depending using player race, Protoss,,,, and Terran can be black ops as well. On time to time playing all original SC2 units existing will be on the game screen of curse just for AI. And do not any Dependencies attached just the basics.
A.I will be always the bad girl, and user the hero. User With his basic units have not time to play and research all, in multiplayer u are done in from 15 to 20 minutes.
My Mode Include a menu options before start and can be played in 3 ways Liberty and all will be Liberty. Swarm and all will be updated, And Void as well. All controlled by Requirements, a lot of work. [Or can be removed by Galaxy and it go straight in to Void.]
I been working in Galaxy Editor, Galaxy Libs, Galaxy Scripting, All units are not using AI Think, are using XML Tactical, is more effective and fast.
Mod Status Custom Data  Plus Galaxy Libs  Lines in Booleans and functions.
Not any modifications to the Original, Just Interacting, and following the scripts game.
Example if 2 Carriers, then build a Carrier Boss.
If 6 Siege Tanks; call down 2 Shock Division siege tanks.
If second town create a Nydus Worm Canal, If in Battle and WarpPrism open, use it for warp the units. Ect.
My last thing doing alone is the Models, puff I´m really bad for that, and with the textures, I’m worse. But slowly, slowly; I´m almost ready.
My plan is to player have another alternative and not just [Allied Commanders Mode]
All is there and used by my A.I. Left 2 Die Zerg’s, Black Ops Terran, and much more.
And of curse following all SC2 as Original be possible.
Shame I have no clue on how to embed images in this new setup (and it won't allow me to upload anything :D)
So yea, super useful, thanks again!
EDIT: This said, looks like I can't convert hybrid nemesis death model from xml back to m3. :/
"File "F:\m3\xmlToM3.py", line 218, in <module> convertFile(filePath, outputDirectory) File "F:\m3\xmlToM3.py", line 166, in convertFile doc = xml.dom.minidom.parse(inputFilePath) File "C:\Users\PC\AppData\Local\Programs\Python\Python36\lib\xml\dom\minidom.py", line 1958, in parse return expatbuilder.parse(file) File "C:\Users\PC\AppData\Local\Programs\Python\Python36\lib\xml\dom\expatbuilder.py", line 911, in parse result = builder.parseFile(fp) File "C:\Users\PC\AppData\Local\Programs\Python\Python36\lib\xml\dom\expatbuilder.py", line 207, in parseFile parser.Parse(buffer, 0) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 156336, column 31"
That's easy to solve. It happens because the names of the materials sometimes have some issues.
"xml.parsers.expat.ExpatError: not well-formed (invalid token): line 156336, column 31" means that the converter didn't understand the character 31 in the line 156.336. You can just remove it or replace it with another.