I fixed the 90 degree rotation bug. The big file size comes from some missing optimizations. The current implementation exports rotation, scale and location data of bones for all animations for all frames. Key frames don't get exported as they defined by the user since the m3 format supports only linear interpolations. By generating a key frame at each frame it's possible to simulate other curves. A possible opimization for the future would be to omit all key frames which can be calculated by linear interpolation. That should reduce the file size drasticly. Since this optimization is another source for wrong animations I don't want to implement them right now.
I am not sure what you mean with that animation duplicates. But the collosi has per default a lot of walk animations.
My bad with the duplication when i compared the two models the list just increased without clearing itself. So by opening the model and removing it will cause the list be become huge.
I let you know if i find any thing else.
I have another question how did you start building this plugin. Cause I want to make a plugin for Skyrim that can handle like animations add the most important the collision with is pretty hard to make in nifscope and the animations are an own file so its gonna get hard to make. but i think i can do it :D . But firs i make it simple, probably import.
I assume that you have taken a look at some other scrips and plugins.
Any tips would be appreciated.
I get how you did it but now I'm stuck
I successfully made the init.py and it was pretty easy.
I have tried to analyze the nif files but its hard to get its structure if you get my point.(binary)
the header was easy to figure out look like this
Gamebryo File Format, Version 188.8.131.52
Then some binary data containing version, endian type, user version = 12, number of blocks, user version 2 = 83, and a lot of other information such as strings and creator
I know the "user version" cause else creation kit freaks out and crashes. Nifscope tells me this values as well, but only when i open a skyrim model
any tips on how to get the valuable information. And how did you do?
I will check the nif.xml that comes with nifscope
What you want to do is called reverse engeneering. You could use that terms for a google search. I didn't need to reverse engeneer the m3 model format, since other people did that already. Credits for figuring out the m3 format go to the people I mention in the structures.xml file.
For questions about how to make a blender addon I suggest you search and ask in a blender related forum.
Is there a way we can get some simple EXE application to change the textures of M3 using your M3 to XML coding then converting backto M3? Like Warcraft 3 had a simple tool called MDX Pather where you open the model and change the texture names. I mean not everone wants to install Python and let's say the solution is using the Blender zip version that supports python - this Blender is so annoyingly a mess if you're used to Milkshape/3ds max older which were similar in look, that I'm not gonna use it in a million years. 3ds max is way more easier to do anything but using a whole program to rename textures ... n/c
Anyway how do I use the script with Blender to convert to XML? What command, the same won't work? If I pasted the M3toXml code in Text Editor and Run Script it gives me an error, so from Python Console idk how to make it work as I am not sure the script is even installed although I click 'Install Add-On' for the M3 to XML and vice-versa
Not everyone is a coder who understands python and what not... hope the day will come when there will be user-made tools (applications not codes or plugins for 3dsmax/blender) because this is what makes the modelling experience so horrible compared to that of war3 - the lack of tools, you need to have 3ds max, blender, python just to do a simple texture rename within the model damn it..
I am not sure if you know it already or not: There is also a python script for converting the xml file back to the m3 format.
I am not sure what speaks against installing python 3. It's btw also very usefull as a calculator.
About a rename tool: I would help another programmer to get started making it, but I don't currently want to spend my rare free time on making a rename tool since it can easily be done trough editing the xml file.
Here is a starting point for a rename python tool, this script allows you to change the file path of the diffuse layer of the first material:
importsysfromgenerateM3LibraryimportgenerateM3LibrarygenerateM3Library()# uses the structure.xml file to generate the m3.py fileimportm3fileName=sys.argv# first argument (argv is the script path)model=m3.loadModel(fileName)oldPath=model.standardMaterials.diffuseLayer.imagePath;print("Diffuse of material 1 was %s"%oldPath)print("Please enter the new path:")newPath=sys.stdin.readline().strip()model.standardMaterials.diffuseLayer.imagePath=newPathm3.saveAndInvalidateModel(model,fileName)
About an exe file: Most parts of the m3 python library generator can be reused for genertors that generate an m3 library for other languages.
So if someone wants to make an m3 library for another language, feel free to contact me as well.
Ok since I have no other choice atm and for hours I couldn't do, how do I use that repositionary in Blender? If I clicked install on your two XML<->M3 scripts to install all they do is appear on the Roaming\Blender Foundation\Scripts\Addons\ folder and in Add-oNs list in blender - No such Addon in the list. Only see some Import-Export Blizzard M3 among the list of Add-Ons not any XML ones.
In Python console? What commands? I dont think am doing anything when it cannot even recognize there is such script. Also what do you mean by 'Clone the repositionary' copy+paste?
With clone I meant that you use git to download the files. Git is a version control system. For Windows I would recommend the TortoiseGit. After installation you can use the context menu of the explorer to clone/download the m3addon. When you select then clone in the git sub menu of the explorer you have to enter an git url. The url for the m3addon is "git://github.com/flo/m3addon.git".
You can also simply click "ZIP" on https://github.com/flo/m3addon if you want to download all files as zip archive, but I recommen using git since it allows to stay a.) up to date and b.) share your changes to the m3addon with other developers.
You can call the scripts from the normal cmd command line like this:
The folder is there yes.. did it. XML scripts do not appear anywhere in the list of Add-Ons. The only ones in the list are Blizzard M3 Import that doesn't work anymore and the newer Import and Export that imports a model without textures. So I can't run the scrips from Blender.
Ok nevermind Blender deleted it. I installed Python 3 for X64 - I did the command from CMD like C:\UserName\Desktop\from Where The M3toXML is located>m3ToXml.m3 (the location where the M3 is aka on Desktop)
And still I don't see an XML anywhere... It created some folder in the folder where the script is:
Generally I would appreciate if someone did this 2-3 minute job for me to convert to XML and after I modify the texture names - back to M3 because I can't continue working on the model if I cannot use the textures..
If you have another Python version installed, I suggest that you uninstall it first before installing the Python version from the link above (which is for 64 bit systems which I assume you use). It would also be nice to know which python version didn't work.
I've not installed Python before and I use 3.2.3 version with win 7 Home Premium x64 bit. I noticed not only m3ToXML but also xmlToM3 shows the same error and no matter what paths and locations I use.. I would've done it ages ago if this was the case but since it will take so much time to convert 2 files to xml then to m3 after I modify them, I will have to look for other ways.
This script clearly isn't set right because I do not have problems with anything else running fine so my PC being a mess - there is no such thing