ufoaiorg / ufoai

UFO:Alien Invasion
http://ufoai.org
GNU General Public License v2.0
148 stars 51 forks source link

Avoid wobbling in static vertices from MD2 files exported via the Blender plugin #29

Closed ghost closed 8 years ago

ghost commented 8 years ago

Sorry for using the issues instead of a pull request, but i do not use UFO:AI nor have git installed.

I found the MD2 exporter from a forum and while it works fine, it introduces wobbling even in static vertices because it recalculates the bounding box for every frame. This is fine for characters or other objects that animate all of their parts, but for partially animated objects this can be annoying. My case was a flag on a pole - the flag waves and this causes the bounding box to change which in turn causes the pole to wobble.

I added a small option to calculate a shared bounding box between all frames and use that instead of calculating a box for each frame. This obviously slows down the export since it has to do two passes and reduces the available resolution, but on the other hand it eliminates the wobble effect on vertices that do not change. The option is disabled by default so the addon should work as previously.

The change is very small and you can even replicate it just by looking at the patch file.

io_mesh_md2-shared-bbox.patch.txt

mgerhardy commented 8 years ago

created a pull request out of it: #31

DarkRainX commented 8 years ago

Patch merged, someone can close the issue now.