absolute-quantum / cats-blender-plugin

:smiley_cat: A tool designed to shorten steps needed to import and optimize models into VRChat. Compatible models are: MMD, XNALara, Mixamo, DAZ/Poser, Blender Rigify, Sims 2, Motion Builder, 3DS Max and potentially more
https://catsblenderplugin.com
MIT License
3.47k stars 453 forks source link

Cleanup proposals #486

Open Mysteryem opened 2 years ago

Mysteryem commented 2 years ago

Organisation

Formatting

Coding conventions and optimisation

Personally, I would also like to drop support for 2.79 (or even all versions older than the current oldest LTS release of 2.83). 2.79 had its final update just over 4 years ago and 2.80 had a lot of breaking changes so there's a lot of code in Cats for specifically handling 2.79 that could be removed. Moving to 2.80+ also moves the minimum Python version to 3.6, giving us access to variable annotations (so we can remove the annotations part of @register_wrap and define properties using annotations), formatted string literals (print(f"Found {mesh.name}")) and dictionaries that preserve insertion order by default (yes, it's only an implementation detail in CPython 3.6, but we know that it was made the standard Python 3.7).

As far as I can tell, the only reason we have google_trans_new copied directly into Cats instead of as a submodule, is so that we can disable all the code that uses urllib3 due to it not being included with 2.79's bundled Python.

Additionally, if we were to drop support for 2.79, would we be able to stop including mmd_tools directly and instead include it as a submodule too? The new 2.3.0 version of mmd_tools itself, that is now in the development branch as mmd_tools_local, dropped support for 2.79 so I can see that we've had to modify it for 2.79 support.

Mysteryem commented 2 years ago

Dropping 2.79 also means we could change some code that requires Edit mode and iterates through a list of meshes, to open all of the required meshes into Edit mode simultaneously instead of opening each mesh individually, due to 2.80's new feature of multi-editing.