I can think of one more reason why it doesn't work. Maybe it's wrongly configured how python scripts get executed.
To bypass this you could call the script like this:
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.
@Eimtr: Go
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 first command converts the model path\To\Model.m3 into the xml file path\To\Model.m3.xml, the second command overrides the m3 file with the content from the xml file.
If you want to use the Blender addon you have to place the complete m3addon directory into the addon path of blender. On Windows it is:
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[1]# first argument (argv[0] is the script path)model=m3.loadModel(fileName)oldPath=model.standardMaterials[0].diffuseLayer[0].imagePath;print("Diffuse of material 1 was %s"%oldPath)print("Please enter the new path:")newPath=sys.stdin.readline().strip()model.standardMaterials[0].diffuseLayer[0].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.
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.
I first started writing the m3 library and noticed that I would be better of generating them from a XML file. Then I started the importer, which I later used to verify the exporter.
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.
Thanks for your bug report. The roll value of the edit bones got calculated wrongly in some corner cases. I fixed the calculation and pushed the changes to my public repository.
Are you sure you used the most current version of the script? I fixed a edit bone import bug recently and for me it loads fine!
I suggest that you create a github account. For logged in users the m3addon repository at github will show two buttons: "Watch" and "Fork".
With "Watch" you can get yourself informed about changes to the repository. If you are interested in helping me making the script you can click "Fork" to create a copy of my m3addon at github. You can then publish your changes (e.g. your structure.xml modifications) to that copy and send me a so called "Pull Request".
Trough that pull request I will know that you have changes for me and then I can integrate your changes into my version.
To load the collosi you have to specify in the structures.xml file the unknown sections.
guessedBytesPerEntry tells you how big the structure propably is.To fix the error about the unknown section RIB_ you could add the following structure:
You can insert the structure anywhere in the list of structures. I tried to order them in a way that structures are defined first before they are referenced by another structure.
When there are no more unknown structures the addon will complain:
Exception: Field MODLV23.ribData can be marked as a reference pointing to RIB_V6
To fix that you have to go to the definition of the structure MODL in version 23 and add a refTo attribute to the field "ribData":
By the way: The addon can export now static meshes. The mesh export functionallity is very basic right now: To export a mesh there must be exactly 1 mesh made out of triangles. That mesh also must have exactly 1 UV layer. Additionally there must be at least one animation and material.
The scripts contain a lot of validation code. The interesting line of your log is the exception message:
SEQSV1.unknown1 has value 1 instead of the expected value int(-1)
So you found a model where the unknown1 field of a SEQS version 1 structure has not the value -1 but 1.
It fails because in the structures.xml file is specified that this particual field is expected to be -1:
The question of course is: what is so special about that animation sequence (SEQS speciefies one animation sequence) that
it has unknown set to 1 instead of -1.
Btw. the script has been written for python 3, it could be that causes trouble too.
With "Rescan" you let the UI search for new changes on your local disk since you started the program/refreshed last. So this option is not what you want.
In git you can download changes other people made without applying them.
In git terms you "fetch" the changes. I think it's possible trough the menu "Remote/Fetch from"Afterwards you can see the branch with my changes in the history. Just click the top of it and select "reset master branch to here". The top entry is currently "Removed a todo line that is done.". It will trow then all your changes away and give you the chosen state.
Alternatively you can "pull" changes too. Which means that you download and apply changes in one step.
To not lose any of your work by resetting I recommend you to google for more information about how git (gui) works once you get it running.
Can you try starting Blender with a command line window (which will propably show an error message when you enable it)?
e.g. Use the windows start button to call the program "cmd" and enter then the full path of the blender binary
Maybe it's visible by default in Windows, not sure.
Can you post the reported error here?
Edit: I just tried what happen what the m3.py file does not exist and I experienced the same problem. The m3.py file didn't get properly generated at the first initialization but only at reload. I fixed it and committed the changes. Thanks for your bug report!
@Eimtr: Go
I can think of one more reason why it doesn't work. Maybe it's wrongly configured how python scripts get executed. To bypass this you could call the script like this:
Where the first part is the file path to the python.exe executable. It might need to be surrounded with " since the path may contain whitespaces.
You might just be 1 minute away from successully making your change.
@Eimtr: Go
Do you use python 3.2.3? I can only think of a python bug. Leruster uses my tool successfully on Windows 7 (x64) with Python 3.2.3. http://www.python.org/ftp/python/3.2.3/python-3.2.3.amd64.msi
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.
@Eimtr: Go
The conversion script tells you where it places the new files. If for example the output looks like this:
then the file is at C:\UserName\Desktop\Model.m3.xml
Since your model was on the desktop, the xml file will be on the desktop as well.
You can specify another output directory if you want to:
You can also pass a directory as argument to the script. Then all m3 files in the directory will get converted.
@Eimtr: Go 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 first command converts the model path\To\Model.m3 into the xml file path\To\Model.m3.xml, the second command overrides the m3 file with the content from the xml file.
If you want to use the Blender addon you have to place the complete m3addon directory into the addon path of blender. On Windows it is:
@Eimtr: Go
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:
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.
@chaos2night: Go
I just added an animation compression algorithm to my m3addon. Exported models should be much smaller now.
@chaos2night: Go
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.
@chaos2night: Go
I first started writing the m3 library and noticed that I would be better of generating them from a XML file. Then I started the importer, which I later used to verify the exporter.
@chaos2night: Go
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.
@chaos2night: Go
Thanks for your bug report. The roll value of the edit bones got calculated wrongly in some corner cases. I fixed the calculation and pushed the changes to my public repository.
@chaos2night: Go
Are you sure you used the most current version of the script? I fixed a edit bone import bug recently and for me it loads fine!
I suggest that you create a github account. For logged in users the m3addon repository at github will show two buttons: "Watch" and "Fork".
With "Watch" you can get yourself informed about changes to the repository. If you are interested in helping me making the script you can click "Fork" to create a copy of my m3addon at github. You can then publish your changes (e.g. your structure.xml modifications) to that copy and send me a so called "Pull Request".
Trough that pull request I will know that you have changes for me and then I can integrate your changes into my version.
@chaos2night: Go
To load the collosi you have to specify in the structures.xml file the unknown sections.
guessedBytesPerEntry tells you how big the structure propably is.To fix the error about the unknown section RIB_ you could add the following structure:
You can insert the structure anywhere in the list of structures. I tried to order them in a way that structures are defined first before they are referenced by another structure.
When there are no more unknown structures the addon will complain:
Exception: Field MODLV23.ribData can be marked as a reference pointing to RIB_V6
To fix that you have to go to the definition of the structure MODL in version 23 and add a refTo attribute to the field "ribData":
By the way: The addon can export now static meshes. The mesh export functionallity is very basic right now: To export a mesh there must be exactly 1 mesh made out of triangles. That mesh also must have exactly 1 UV layer. Additionally there must be at least one animation and material.
@JackRCDF: Go
The scripts contain a lot of validation code. The interesting line of your log is the exception message:
SEQSV1.unknown1 has value 1 instead of the expected value int(-1)
So you found a model where the unknown1 field of a SEQS version 1 structure has not the value -1 but 1.
It fails because in the structures.xml file is specified that this particual field is expected to be -1:
if you change "expeccted-value" to "default-value" the model should load(or another error should be shown:
The question of course is: what is so special about that animation sequence (SEQS speciefies one animation sequence) that
it has unknown set to 1 instead of -1.
Btw. the script has been written for python 3, it could be that causes trouble too.
@JackRCDF: Go
With "Rescan" you let the UI search for new changes on your local disk since you started the program/refreshed last. So this option is not what you want.
In git you can download changes other people made without applying them. In git terms you "fetch" the changes. I think it's possible trough the menu "Remote/Fetch from"Afterwards you can see the branch with my changes in the history. Just click the top of it and select "reset master branch to here". The top entry is currently "Removed a todo line that is done.". It will trow then all your changes away and give you the chosen state.
Alternatively you can "pull" changes too. Which means that you download and apply changes in one step.
To not lose any of your work by resetting I recommend you to google for more information about how git (gui) works once you get it running.
@JackRCDF: Go
Can you try starting Blender with a command line window (which will propably show an error message when you enable it)?
e.g. Use the windows start button to call the program "cmd" and enter then the full path of the blender binary
Maybe it's visible by default in Windows, not sure.
Can you post the reported error here?
Edit: I just tried what happen what the m3.py file does not exist and I experienced the same problem. The m3.py file didn't get properly generated at the first initialization but only at reload. I fixed it and committed the changes. Thanks for your bug report!