Add linux support & various bug fixes.#78
Conversation
|
Tested this personally on Blender 4.2.X (Windows) and Blender 5.1.0 (CachyOS), no issues noticed on my end. |
|
I have also done few more improvements/rewrites to long running functions during export. However, I will include a short comparison example. I used cProfile to profile the before and after for these changes. Before: After, same .p3d being exported: The results speak for themselves XD. This test was run on a not too complex model, first visual LOD ~10k triangles on CachyOS. This code is available on my master branch |
Linux Support
Will fix #74
More comprehensive alternative to #77
Added linux support via
blender_manifest.tomland inArmaTools.py->RunO2Script(), it should be checking now which OS the user is on and handles how o2script is run.In my system, CachyOS, I made a wrapper for o2script.exe with the following code, this could be noted in the
README.mdunder a new Linux compatibility (experimental) tab?The user would add this o2script_wrapper.sh to the o2script path in the Blender Addon Settings.
"Various bug fixes"
Before, if the user had an error, e.g n-gons in any meshes, the addon would error out and lock the .p3d file, until blender was restarted. This could also happen for other exported file types like .rtm and .asc.
Now, the various bug fixes were mainly about adding try/except blocks to
filePtrlines throughout the entire code base.After:
I realize the code is super old and
withblocks may have not existed back when it was first written, alas python is not C and we can usewithas a context manager to open and close files gracefully.